From ce961cddb3161b6209379ad948aabde898296bd5 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Mon, 5 Jan 2026 22:28:19 +0000 Subject: [PATCH 1/2] feat: add custom prompt config in the request and return prompt in the response feat: update min_speaker_count and max_speaker_count to be optional docs: Clarify that min_speaker_count and max_speaker_count in SpeakerDiarizationConfig are not currently used docs: Update guidance on how to enable speaker diarization; to enable, set the diarization_config field to an empty SpeakerDiarizationConfig message PiperOrigin-RevId: 852383212 Source-Link: https://github.com/googleapis/googleapis/commit/1a141530079896691c100e0624705f2e0923f864 Source-Link: https://github.com/googleapis/googleapis-gen/commit/c84243caa11c7fc89056e0bd07b4c4c6aea0510b Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXJlZGlzLXYxLy5Pd2xCb3QueWFtbCIsImgiOiJjODQyNDNjYWExMWM3ZmM4OTA1NmUwYmQwN2I0YzRjNmFlYTA1MTBiIn0= Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXJlZGlzLXYxYmV0YTEvLk93bEJvdC55YW1sIiwiaCI6ImM4NDI0M2NhYTExYzdmYzg5MDU2ZTBiZDA3YjRjNGM2YWVhMDUxMGIifQ== Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXJlZGlzLy5Pd2xCb3QueWFtbCIsImgiOiJjODQyNDNjYWExMWM3ZmM4OTA1NmUwYmQwN2I0YzRjNmFlYTA1MTBiIn0= Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXJlc291cmNlX21hbmFnZXItdjMvLk93bEJvdC55YW1sIiwiaCI6ImM4NDI0M2NhYTExYzdmYzg5MDU2ZTBiZDA3YjRjNGM2YWVhMDUxMGIifQ== Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXJlc291cmNlX21hbmFnZXIvLk93bEJvdC55YW1sIiwiaCI6ImM4NDI0M2NhYTExYzdmYzg5MDU2ZTBiZDA3YjRjNGM2YWVhMDUxMGIifQ== Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXJldGFpbC12Mi8uT3dsQm90LnlhbWwiLCJoIjoiYzg0MjQzY2FhMTFjN2ZjODkwNTZlMGJkMDdiNGM0YzZhZWEwNTEwYiJ9 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXJldGFpbC8uT3dsQm90LnlhbWwiLCJoIjoiYzg0MjQzY2FhMTFjN2ZjODkwNTZlMGJkMDdiNGM0YzZhZWEwNTEwYiJ9 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXJ1bi1jbGllbnQvLk93bEJvdC55YW1sIiwiaCI6ImM4NDI0M2NhYTExYzdmYzg5MDU2ZTBiZDA3YjRjNGM2YWVhMDUxMGIifQ== Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXNhYXNfcGxhdGZvcm0tc2Fhc19zZXJ2aWNlX21nbXQtdjFiZXRhMS8uT3dsQm90LnlhbWwiLCJoIjoiYzg0MjQzY2FhMTFjN2ZjODkwNTZlMGJkMDdiNGM0YzZhZWEwNTEwYiJ9 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXNhYXNfcGxhdGZvcm0tc2Fhc19zZXJ2aWNlX21nbXQvLk93bEJvdC55YW1sIiwiaCI6ImM4NDI0M2NhYTExYzdmYzg5MDU2ZTBiZDA3YjRjNGM2YWVhMDUxMGIifQ== Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXNjaGVkdWxlci12MS8uT3dsQm90LnlhbWwiLCJoIjoiYzg0MjQzY2FhMTFjN2ZjODkwNTZlMGJkMDdiNGM0YzZhZWEwNTEwYiJ9 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXNjaGVkdWxlci12MWJldGExLy5Pd2xCb3QueWFtbCIsImgiOiJjODQyNDNjYWExMWM3ZmM4OTA1NmUwYmQwN2I0YzRjNmFlYTA1MTBiIn0= Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXNjaGVkdWxlci8uT3dsQm90LnlhbWwiLCJoIjoiYzg0MjQzY2FhMTFjN2ZjODkwNTZlMGJkMDdiNGM0YzZhZWEwNTEwYiJ9 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXNlY3JldF9tYW5hZ2VyLXYxLy5Pd2xCb3QueWFtbCIsImgiOiJjODQyNDNjYWExMWM3ZmM4OTA1NmUwYmQwN2I0YzRjNmFlYTA1MTBiIn0= Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXNlY3JldF9tYW5hZ2VyLXYxYmV0YTEvLk93bEJvdC55YW1sIiwiaCI6ImM4NDI0M2NhYTExYzdmYzg5MDU2ZTBiZDA3YjRjNGM2YWVhMDUxMGIifQ== Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXNlY3JldF9tYW5hZ2VyLXYxYmV0YTIvLk93bEJvdC55YW1sIiwiaCI6ImM4NDI0M2NhYTExYzdmYzg5MDU2ZTBiZDA3YjRjNGM2YWVhMDUxMGIifQ== Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXNlY3JldF9tYW5hZ2VyLy5Pd2xCb3QueWFtbCIsImgiOiJjODQyNDNjYWExMWM3ZmM4OTA1NmUwYmQwN2I0YzRjNmFlYTA1MTBiIn0= Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXNlY3VyZV9zb3VyY2VfbWFuYWdlci12MS8uT3dsQm90LnlhbWwiLCJoIjoiYzg0MjQzY2FhMTFjN2ZjODkwNTZlMGJkMDdiNGM0YzZhZWEwNTEwYiJ9 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXNlY3VyZV9zb3VyY2VfbWFuYWdlci8uT3dsQm90LnlhbWwiLCJoIjoiYzg0MjQzY2FhMTFjN2ZjODkwNTZlMGJkMDdiNGM0YzZhZWEwNTEwYiJ9 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXNlY3VyaXR5LXByaXZhdGVfY2EtdjEvLk93bEJvdC55YW1sIiwiaCI6ImM4NDI0M2NhYTExYzdmYzg5MDU2ZTBiZDA3YjRjNGM2YWVhMDUxMGIifQ== --- .../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 | 11 + .../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 | 94 + .../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 | 473 ++ .../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 | 25 + .../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 | 11 + .../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 | 91 + .../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 | 473 ++ .../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 | 25 + owl-bot-staging/google-cloud-redis/.gitignore | 22 + .../google-cloud-redis/.repo-metadata.json | 18 + .../google-cloud-redis/.rubocop.yml | 39 + owl-bot-staging/google-cloud-redis/.toys.rb | 28 + owl-bot-staging/google-cloud-redis/.yardopts | 11 + .../google-cloud-redis/AUTHENTICATION.md | 122 + .../google-cloud-redis/CHANGELOG.md | 2 + owl-bot-staging/google-cloud-redis/Gemfile | 28 + owl-bot-staging/google-cloud-redis/LICENSE.md | 201 + owl-bot-staging/google-cloud-redis/README.md | 142 + owl-bot-staging/google-cloud-redis/Rakefile | 169 + .../google-cloud-redis.gemspec | 27 + .../lib/google-cloud-redis.rb | 19 + .../lib/google/cloud/redis.rb | 170 + .../lib/google/cloud/redis/version.rb | 26 + .../test/google/cloud/redis/client_test.rb | 64 + .../test/google/cloud/redis/version_test.rb | 26 + .../google-cloud-redis/test/helper.rb | 25 + .../.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 | 11 + .../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 | 70 + .../resourcemanager/v3/folders_services_pb.rb | 172 + .../resourcemanager/v3/organizations_pb.rb | 57 + .../v3/organizations_services_pb.rb | 73 + .../cloud/resourcemanager/v3/projects_pb.rb | 70 + .../v3/projects_services_pb.rb | 190 + .../resourcemanager/v3/tag_bindings_pb.rb | 58 + .../v3/tag_bindings_services_pb.rb | 57 + .../cloud/resourcemanager/v3/tag_holds_pb.rb | 57 + .../v3/tag_holds_services_pb.rb | 54 + .../cloud/resourcemanager/v3/tag_keys_pb.rb | 65 + .../v3/tag_keys_services_pb.rb | 81 + .../cloud/resourcemanager/v3/tag_values_pb.rb | 64 + .../v3/tag_values_services_pb.rb | 81 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 473 ++ .../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 | 25 + .../google-cloud-resource_manager/.gitignore | 22 + .../.repo-metadata.json | 15 + .../.rubocop.yml | 39 + .../google-cloud-resource_manager/.toys.rb | 28 + .../google-cloud-resource_manager/.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../google-cloud-resource_manager/Gemfile | 28 + .../google-cloud-resource_manager/LICENSE.md | 201 + .../google-cloud-resource_manager/README.md | 147 + .../google-cloud-resource_manager/Rakefile | 169 + .../google-cloud-resource_manager.gemspec | 27 + .../lib/google-cloud-resource_manager.rb | 19 + .../lib/google/cloud/resource_manager.rb | 583 ++ .../google/cloud/resource_manager/version.rb | 26 + .../cloud/resource_manager/client_test.rb | 190 + .../cloud/resource_manager/version_test.rb | 26 + .../test/helper.rb | 25 + .../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 | 11 + .../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 | 48 + .../v2/analytics_service_services_pb.rb | 49 + .../lib/google/cloud/retail/v2/catalog_pb.rb | 66 + .../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 | 66 + .../retail/v2/catalog_service_services_pb.rb | 125 + .../lib/google/cloud/retail/v2/common_pb.rb | 80 + .../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 | 55 + .../v2/completion_service_services_pb.rb | 61 + .../lib/google/cloud/retail/v2/control_pb.rb | 47 + .../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 | 57 + .../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 | 65 + ...nversational_search_service_services_pb.rb | 52 + .../cloud/retail/v2/export_config_pb.rb | 58 + .../cloud/retail/v2/generative_question_pb.rb | 45 + .../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 | 57 + ...generative_question_service_services_pb.rb | 55 + .../cloud/retail/v2/import_config_pb.rb | 73 + .../lib/google/cloud/retail/v2/model_pb.rb | 56 + .../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 | 64 + .../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 | 53 + .../v2/prediction_service_services_pb.rb | 45 + .../lib/google/cloud/retail/v2/product_pb.rb | 59 + .../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 | 79 + .../retail/v2/product_service_services_pb.rb | 248 + .../google/cloud/retail/v2/promotion_pb.rb | 42 + .../google/cloud/retail/v2/purge_config_pb.rb | 52 + .../lib/google/cloud/retail/v2/rest.rb | 48 + .../lib/google/cloud/retail/v2/safety_pb.rb | 47 + .../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 | 86 + .../retail/v2/search_service_services_pb.rb | 51 + .../cloud/retail/v2/serving_config_pb.rb | 49 + .../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 | 59 + .../v2/serving_config_service_services_pb.rb | 74 + .../google/cloud/retail/v2/user_event_pb.rb | 55 + .../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 | 58 + .../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 | 473 ++ .../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 | 121 + .../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 | 25 + .../google-cloud-retail/.gitignore | 22 + .../google-cloud-retail/.repo-metadata.json | 18 + .../google-cloud-retail/.rubocop.yml | 39 + owl-bot-staging/google-cloud-retail/.toys.rb | 28 + owl-bot-staging/google-cloud-retail/.yardopts | 11 + .../google-cloud-retail/AUTHENTICATION.md | 122 + .../google-cloud-retail/CHANGELOG.md | 2 + owl-bot-staging/google-cloud-retail/Gemfile | 28 + .../google-cloud-retail/LICENSE.md | 201 + owl-bot-staging/google-cloud-retail/README.md | 142 + owl-bot-staging/google-cloud-retail/Rakefile | 169 + .../google-cloud-retail.gemspec | 27 + .../lib/google-cloud-retail.rb | 19 + .../lib/google/cloud/retail.rb | 949 +++ .../lib/google/cloud/retail/version.rb | 26 + .../test/google/cloud/retail/client_test.rb | 295 + .../test/google/cloud/retail/version_test.rb | 26 + .../google-cloud-retail/test/helper.rb | 25 + .../google-cloud-run-client/.gitignore | 22 + .../.repo-metadata.json | 17 + .../google-cloud-run-client/.rubocop.yml | 39 + .../google-cloud-run-client/.toys.rb | 28 + .../google-cloud-run-client/.yardopts | 11 + .../google-cloud-run-client/AUTHENTICATION.md | 122 + .../google-cloud-run-client/CHANGELOG.md | 2 + .../google-cloud-run-client/Gemfile | 28 + .../google-cloud-run-client/LICENSE.md | 201 + .../google-cloud-run-client/README.md | 142 + .../google-cloud-run-client/Rakefile | 169 + .../google-cloud-run.gemspec | 27 + .../lib/google-cloud-run.rb | 19 + .../lib/google/cloud/run.rb | 576 ++ .../lib/google/cloud/run/version.rb | 26 + .../test/google/cloud/run/client_test.rb | 190 + .../test/google/cloud/run/version_test.rb | 26 + .../google-cloud-run-client/test/helper.rb | 25 + .../.gitignore | 22 + .../.repo-metadata.json | 17 + .../.rubocop.yml | 33 + .../.toys.rb | 28 + .../.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../Gemfile | 11 + .../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 | 58 + .../v1beta1/deployments_resources_pb.rb | 73 + .../v1beta1/deployments_service_pb.rb | 89 + .../deployments_service_services_pb.rb | 105 + .../v1beta1/rollouts_resources_pb.rb | 60 + .../v1beta1/rollouts_service_pb.rb | 65 + .../v1beta1/rollouts_service_services_pb.rb | 65 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 473 ++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/field_info.rb | 88 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../saasservicemgmt/v1beta1/common.rb | 231 + .../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 | 25 + .../.gitignore | 22 + .../.repo-metadata.json | 17 + .../.rubocop.yml | 39 + .../.toys.rb | 28 + .../.yardopts | 11 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../Gemfile | 28 + .../LICENSE.md | 201 + .../README.md | 142 + .../Rakefile | 169 + ...ud-saas_platform-saas_service_mgmt.gemspec | 27 + ...e-cloud-saas_platform-saas_service_mgmt.rb | 19 + .../cloud/saas_platform/saas_service_mgmt.rb | 228 + .../saas_service_mgmt/version.rb | 28 + .../saas_service_mgmt/client_test.rb | 85 + .../saas_service_mgmt/version_test.rb | 26 + .../test/helper.rb | 25 + .../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 | 11 + .../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 | 60 + .../v1/cloudscheduler_services_pb.rb | 89 + .../lib/google/cloud/scheduler/v1/job_pb.rb | 55 + .../lib/google/cloud/scheduler/v1/rest.rb | 38 + .../google/cloud/scheduler/v1/target_pb.rb | 50 + .../lib/google/cloud/scheduler/v1/version.rb | 28 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 473 ++ .../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 | 25 + .../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 | 11 + .../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 | 60 + .../v1beta1/cloudscheduler_services_pb.rb | 92 + .../google/cloud/scheduler/v1beta1/job_pb.rb | 55 + .../google/cloud/scheduler/v1beta1/rest.rb | 38 + .../cloud/scheduler/v1beta1/target_pb.rb | 50 + .../google/cloud/scheduler/v1beta1/version.rb | 28 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 473 ++ .../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 | 25 + .../google-cloud-scheduler/.gitignore | 22 + .../.repo-metadata.json | 18 + .../google-cloud-scheduler/.rubocop.yml | 39 + .../google-cloud-scheduler/.toys.rb | 28 + .../google-cloud-scheduler/.yardopts | 11 + .../google-cloud-scheduler/AUTHENTICATION.md | 122 + .../google-cloud-scheduler/CHANGELOG.md | 2 + .../google-cloud-scheduler/Gemfile | 28 + .../google-cloud-scheduler/LICENSE.md | 201 + .../google-cloud-scheduler/README.md | 142 + .../google-cloud-scheduler/Rakefile | 169 + .../google-cloud-scheduler.gemspec | 27 + .../lib/google-cloud-scheduler.rb | 19 + .../lib/google/cloud/scheduler.rb | 157 + .../lib/google/cloud/scheduler/version.rb | 26 + .../google/cloud/scheduler/client_test.rb | 64 + .../google/cloud/scheduler/version_test.rb | 26 + .../google-cloud-scheduler/test/helper.rb | 25 + .../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 | 11 + .../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 | 64 + .../cloud/secretmanager/v1/service_pb.rb | 68 + .../secretmanager/v1/service_services_pb.rb | 118 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 473 ++ .../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 | 25 + .../.gitignore | 22 + .../.repo-metadata.json | 18 + .../.rubocop.yml | 33 + .../.toys.rb | 28 + .../.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../Gemfile | 11 + .../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 | 54 + .../cloud/secrets/v1beta1/service_pb.rb | 68 + .../secrets/v1beta1/service_services_pb.rb | 117 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 473 ++ .../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 | 25 + .../.gitignore | 22 + .../.repo-metadata.json | 18 + .../.rubocop.yml | 33 + .../.toys.rb | 28 + .../.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../Gemfile | 11 + .../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 | 64 + .../cloud/secretmanager/v1beta2/service_pb.rb | 68 + .../v1beta2/service_services_pb.rb | 125 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 473 ++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/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 | 25 + .../google-cloud-secret_manager/.gitignore | 22 + .../.repo-metadata.json | 18 + .../google-cloud-secret_manager/.rubocop.yml | 39 + .../google-cloud-secret_manager/.toys.rb | 28 + .../google-cloud-secret_manager/.yardopts | 11 + .../AUTHENTICATION.md | 122 + .../google-cloud-secret_manager/CHANGELOG.md | 2 + .../google-cloud-secret_manager/Gemfile | 28 + .../google-cloud-secret_manager/LICENSE.md | 201 + .../google-cloud-secret_manager/README.md | 142 + .../google-cloud-secret_manager/Rakefile | 169 + .../google-cloud-secret_manager.gemspec | 27 + .../lib/google-cloud-secret_manager.rb | 19 + .../lib/google/cloud/secret_manager.rb | 153 + .../google/cloud/secret_manager/version.rb | 26 + .../cloud/secret_manager/client_test.rb | 53 + .../cloud/secret_manager/version_test.rb | 26 + .../test/helper.rb | 25 + .../.gitignore | 22 + .../.repo-metadata.json | 17 + .../.rubocop.yml | 33 + .../.toys.rb | 28 + .../.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../Gemfile | 11 + .../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 | 148 + .../v1/secure_source_manager_services_pb.rb | 170 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 473 ++ .../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 | 25 + .../.gitignore | 22 + .../.repo-metadata.json | 17 + .../.rubocop.yml | 39 + .../.toys.rb | 28 + .../.yardopts | 11 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../Gemfile | 28 + .../LICENSE.md | 201 + .../README.md | 142 + .../Rakefile | 169 + ...google-cloud-secure_source_manager.gemspec | 27 + .../lib/google-cloud-secure_source_manager.rb | 19 + .../lib/google/cloud/secure_source_manager.rb | 158 + .../cloud/secure_source_manager/version.rb | 26 + .../secure_source_manager/client_test.rb | 64 + .../secure_source_manager/version_test.rb | 26 + .../test/helper.rb | 25 + .../.gitignore | 22 + .../.repo-metadata.json | 18 + .../.rubocop.yml | 33 + .../.toys.rb | 28 + .../.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../Gemfile | 11 + .../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 | 104 + .../cloud/security/privateca/v1/service_pb.rb | 95 + .../privateca/v1/service_services_pb.rb | 150 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 473 ++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/field_info.rb | 88 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../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 | 25 + 1349 files changed, 305638 insertions(+) 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-redis/.gitignore create mode 100644 owl-bot-staging/google-cloud-redis/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-redis/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-redis/.toys.rb create mode 100644 owl-bot-staging/google-cloud-redis/.yardopts create mode 100644 owl-bot-staging/google-cloud-redis/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-redis/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-redis/Gemfile create mode 100644 owl-bot-staging/google-cloud-redis/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-redis/README.md create mode 100644 owl-bot-staging/google-cloud-redis/Rakefile create mode 100644 owl-bot-staging/google-cloud-redis/google-cloud-redis.gemspec create mode 100644 owl-bot-staging/google-cloud-redis/lib/google-cloud-redis.rb create mode 100644 owl-bot-staging/google-cloud-redis/lib/google/cloud/redis.rb create mode 100644 owl-bot-staging/google-cloud-redis/lib/google/cloud/redis/version.rb create mode 100644 owl-bot-staging/google-cloud-redis/test/google/cloud/redis/client_test.rb create mode 100644 owl-bot-staging/google-cloud-redis/test/google/cloud/redis/version_test.rb create mode 100644 owl-bot-staging/google-cloud-redis/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-resource_manager/.gitignore create mode 100644 owl-bot-staging/google-cloud-resource_manager/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-resource_manager/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-resource_manager/.toys.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager/.yardopts create mode 100644 owl-bot-staging/google-cloud-resource_manager/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-resource_manager/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-resource_manager/Gemfile create mode 100644 owl-bot-staging/google-cloud-resource_manager/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-resource_manager/README.md create mode 100644 owl-bot-staging/google-cloud-resource_manager/Rakefile create mode 100644 owl-bot-staging/google-cloud-resource_manager/google-cloud-resource_manager.gemspec create mode 100644 owl-bot-staging/google-cloud-resource_manager/lib/google-cloud-resource_manager.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager/lib/google/cloud/resource_manager.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager/lib/google/cloud/resource_manager/version.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager/test/google/cloud/resource_manager/client_test.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager/test/google/cloud/resource_manager/version_test.rb create mode 100644 owl-bot-staging/google-cloud-resource_manager/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-retail/.gitignore create mode 100644 owl-bot-staging/google-cloud-retail/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-retail/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-retail/.toys.rb create mode 100644 owl-bot-staging/google-cloud-retail/.yardopts create mode 100644 owl-bot-staging/google-cloud-retail/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-retail/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-retail/Gemfile create mode 100644 owl-bot-staging/google-cloud-retail/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-retail/README.md create mode 100644 owl-bot-staging/google-cloud-retail/Rakefile create mode 100644 owl-bot-staging/google-cloud-retail/google-cloud-retail.gemspec create mode 100644 owl-bot-staging/google-cloud-retail/lib/google-cloud-retail.rb create mode 100644 owl-bot-staging/google-cloud-retail/lib/google/cloud/retail.rb create mode 100644 owl-bot-staging/google-cloud-retail/lib/google/cloud/retail/version.rb create mode 100644 owl-bot-staging/google-cloud-retail/test/google/cloud/retail/client_test.rb create mode 100644 owl-bot-staging/google-cloud-retail/test/google/cloud/retail/version_test.rb create mode 100644 owl-bot-staging/google-cloud-retail/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-run-client/.gitignore create mode 100644 owl-bot-staging/google-cloud-run-client/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-run-client/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-run-client/.toys.rb create mode 100644 owl-bot-staging/google-cloud-run-client/.yardopts create mode 100644 owl-bot-staging/google-cloud-run-client/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-run-client/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-run-client/Gemfile create mode 100644 owl-bot-staging/google-cloud-run-client/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-run-client/README.md create mode 100644 owl-bot-staging/google-cloud-run-client/Rakefile create mode 100644 owl-bot-staging/google-cloud-run-client/google-cloud-run.gemspec create mode 100644 owl-bot-staging/google-cloud-run-client/lib/google-cloud-run.rb create mode 100644 owl-bot-staging/google-cloud-run-client/lib/google/cloud/run.rb create mode 100644 owl-bot-staging/google-cloud-run-client/lib/google/cloud/run/version.rb create mode 100644 owl-bot-staging/google-cloud-run-client/test/google/cloud/run/client_test.rb create mode 100644 owl-bot-staging/google-cloud-run-client/test/google/cloud/run/version_test.rb create mode 100644 owl-bot-staging/google-cloud-run-client/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-saas_platform-saas_service_mgmt/.gitignore create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/.toys.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/.yardopts create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/Gemfile create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/README.md create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/Rakefile create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/google-cloud-saas_platform-saas_service_mgmt.gemspec create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/lib/google-cloud-saas_platform-saas_service_mgmt.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/lib/google/cloud/saas_platform/saas_service_mgmt.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/lib/google/cloud/saas_platform/saas_service_mgmt/version.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/test/google/cloud/saas_platform/saas_service_mgmt/client_test.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/test/google/cloud/saas_platform/saas_service_mgmt/version_test.rb create mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/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-scheduler/.gitignore create mode 100644 owl-bot-staging/google-cloud-scheduler/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-scheduler/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-scheduler/.toys.rb create mode 100644 owl-bot-staging/google-cloud-scheduler/.yardopts create mode 100644 owl-bot-staging/google-cloud-scheduler/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-scheduler/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-scheduler/Gemfile create mode 100644 owl-bot-staging/google-cloud-scheduler/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-scheduler/README.md create mode 100644 owl-bot-staging/google-cloud-scheduler/Rakefile create mode 100644 owl-bot-staging/google-cloud-scheduler/google-cloud-scheduler.gemspec create mode 100644 owl-bot-staging/google-cloud-scheduler/lib/google-cloud-scheduler.rb create mode 100644 owl-bot-staging/google-cloud-scheduler/lib/google/cloud/scheduler.rb create mode 100644 owl-bot-staging/google-cloud-scheduler/lib/google/cloud/scheduler/version.rb create mode 100644 owl-bot-staging/google-cloud-scheduler/test/google/cloud/scheduler/client_test.rb create mode 100644 owl-bot-staging/google-cloud-scheduler/test/google/cloud/scheduler/version_test.rb create mode 100644 owl-bot-staging/google-cloud-scheduler/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-secret_manager/.gitignore create mode 100644 owl-bot-staging/google-cloud-secret_manager/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-secret_manager/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-secret_manager/.toys.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager/.yardopts create mode 100644 owl-bot-staging/google-cloud-secret_manager/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-secret_manager/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-secret_manager/Gemfile create mode 100644 owl-bot-staging/google-cloud-secret_manager/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-secret_manager/README.md create mode 100644 owl-bot-staging/google-cloud-secret_manager/Rakefile create mode 100644 owl-bot-staging/google-cloud-secret_manager/google-cloud-secret_manager.gemspec create mode 100644 owl-bot-staging/google-cloud-secret_manager/lib/google-cloud-secret_manager.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager/lib/google/cloud/secret_manager.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager/lib/google/cloud/secret_manager/version.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager/test/google/cloud/secret_manager/client_test.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager/test/google/cloud/secret_manager/version_test.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager/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-secure_source_manager/.gitignore create mode 100644 owl-bot-staging/google-cloud-secure_source_manager/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-secure_source_manager/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-secure_source_manager/.toys.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager/.yardopts create mode 100644 owl-bot-staging/google-cloud-secure_source_manager/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-secure_source_manager/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-secure_source_manager/Gemfile create mode 100644 owl-bot-staging/google-cloud-secure_source_manager/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-secure_source_manager/README.md create mode 100644 owl-bot-staging/google-cloud-secure_source_manager/Rakefile create mode 100644 owl-bot-staging/google-cloud-secure_source_manager/google-cloud-secure_source_manager.gemspec create mode 100644 owl-bot-staging/google-cloud-secure_source_manager/lib/google-cloud-secure_source_manager.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager/lib/google/cloud/secure_source_manager.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager/lib/google/cloud/secure_source_manager/version.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager/test/google/cloud/secure_source_manager/client_test.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager/test/google/cloud/secure_source_manager/version_test.rb create mode 100644 owl-bot-staging/google-cloud-secure_source_manager/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 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..6442df18fa2f --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/Gemfile @@ -0,0 +1,11 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.31.1" +gem "minitest", "~> 5.22" +gem "minitest-focus", "~> 1.4" +gem "minitest-rg", "~> 5.3" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-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..3a409c712627 --- /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.1" + + 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..52470c44018e --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis_pb.rb @@ -0,0 +1,94 @@ +# 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 + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.type.TimeOfDay", "google/type/timeofday.proto"], + ["google.protobuf.Duration", "google/protobuf/duration.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module 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..d59ba51a5612 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/api/client.rb @@ -0,0 +1,473 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] experimental_features + # @return [::Google::Api::PythonSettings::ExperimentalFeatures] + # Experimental features to be included during client library generation. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Experimental features to be included during client library generation. + # These fields will be deprecated once the feature graduates and is enabled + # by default. + # @!attribute [rw] rest_async_io_enabled + # @return [::Boolean] + # Enables generation of asynchronous REST clients if `rest` transport is + # enabled. By default, asynchronous REST clients will not be generated. + # This feature will be enabled by default 1 month after launching the + # feature in preview packages. + # @!attribute [rw] protobuf_pythonic_types_enabled + # @return [::Boolean] + # Enables generation of protobuf code using new types that are more + # Pythonic which are included in `protobuf>=5.29.x`. This feature will be + # enabled by default 1 month after launching the feature in preview + # packages. + # @!attribute [rw] unversioned_package_disabled + # @return [::Boolean] + # Disables generation of an unversioned Python package for this client + # library. This means that the module names will need to be versioned in + # import statements. For example `import google.cloud.library_v2` instead + # of `import google.cloud.library`. + class ExperimentalFeatures + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map of service names to renamed services. Keys are the package relative + # service names and values are the name to be used for the service client + # and call options. + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # + # Example: + # + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # This message is used to configure the generation of a subset of the RPCs in + # a service for client libraries. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/owl-bot-staging/google-cloud-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..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" + +require "ostruct" 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..6442df18fa2f --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/Gemfile @@ -0,0 +1,11 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.31.1" +gem "minitest", "~> 5.22" +gem "minitest-focus", "~> 1.4" +gem "minitest-rg", "~> 5.3" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-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..cb00dcb15690 --- /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.1" + + 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..085c79bde265 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis_pb.rb @@ -0,0 +1,91 @@ +# 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 + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.type.TimeOfDay", "google/type/timeofday.proto"], + ["google.protobuf.Duration", "google/protobuf/duration.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module 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..d59ba51a5612 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/api/client.rb @@ -0,0 +1,473 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] experimental_features + # @return [::Google::Api::PythonSettings::ExperimentalFeatures] + # Experimental features to be included during client library generation. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Experimental features to be included during client library generation. + # These fields will be deprecated once the feature graduates and is enabled + # by default. + # @!attribute [rw] rest_async_io_enabled + # @return [::Boolean] + # Enables generation of asynchronous REST clients if `rest` transport is + # enabled. By default, asynchronous REST clients will not be generated. + # This feature will be enabled by default 1 month after launching the + # feature in preview packages. + # @!attribute [rw] protobuf_pythonic_types_enabled + # @return [::Boolean] + # Enables generation of protobuf code using new types that are more + # Pythonic which are included in `protobuf>=5.29.x`. This feature will be + # enabled by default 1 month after launching the feature in preview + # packages. + # @!attribute [rw] unversioned_package_disabled + # @return [::Boolean] + # Disables generation of an unversioned Python package for this client + # library. This means that the module names will need to be versioned in + # import statements. For example `import google.cloud.library_v2` instead + # of `import google.cloud.library`. + class ExperimentalFeatures + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map of service names to renamed services. Keys are the package relative + # service names and values are the name to be used for the service client + # and call options. + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # + # Example: + # + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # This message is used to configure the generation of a subset of the RPCs in + # a service for client libraries. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/owl-bot-staging/google-cloud-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..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis-v1beta1/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" + +require "ostruct" diff --git a/owl-bot-staging/google-cloud-redis/.gitignore b/owl-bot-staging/google-cloud-redis/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-redis/.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/.repo-metadata.json b/owl-bot-staging/google-cloud-redis/.repo-metadata.json new file mode 100644 index 000000000000..dcc38b4fbac7 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis/.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/latest", + "distribution_name": "google-cloud-redis", + "is_cloud": true, + "language": "ruby", + "name": "redis", + "name_pretty": "Google Cloud Memorystore for Redis 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.", + "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/.rubocop.yml b/owl-bot-staging/google-cloud-redis/.rubocop.yml new file mode 100644 index 000000000000..2251f5deb43a --- /dev/null +++ b/owl-bot-staging/google-cloud-redis/.rubocop.yml @@ -0,0 +1,39 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-redis.gemspec" + - "Rakefile" + - "acceptance/**/*" + - "test/**/*" + +Bundler/OrderedGems: + Enabled: false +Documentation: + Enabled: false +Layout/LineLength: + Enabled: false +Metrics/BlockLength: + Exclude: + - "samples/**/acceptance/*.rb" +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/FileName: + Exclude: + - "lib/google-cloud-redis.rb" + +Style/BlockDelimiters: + Exclude: + - "samples/**/acceptance/*.rb" diff --git a/owl-bot-staging/google-cloud-redis/.toys.rb b/owl-bot-staging/google-cloud-redis/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-redis/.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/.yardopts b/owl-bot-staging/google-cloud-redis/.yardopts new file mode 100644 index 000000000000..99a35e32f21f --- /dev/null +++ b/owl-bot-staging/google-cloud-redis/.yardopts @@ -0,0 +1,11 @@ +--no-private +--title="Google Cloud Memorystore for Redis API" +--exclude _pb\.rb$ +--markup markdown +--markup-provider redcarpet + +./lib/**/*.rb +- +README.md +AUTHENTICATION.md +LICENSE.md diff --git a/owl-bot-staging/google-cloud-redis/AUTHENTICATION.md b/owl-bot-staging/google-cloud-redis/AUTHENTICATION.md new file mode 100644 index 000000000000..ea9c72a70bac --- /dev/null +++ b/owl-bot-staging/google-cloud-redis/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-redis 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 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" + +client = Google::Cloud::Redis.cloud_redis do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/redis" + +Google::Cloud::Redis.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = Google::Cloud::Redis.cloud_redis +``` + +### 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 +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" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = Google::Cloud::Redis.cloud_redis +``` + +### 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/CHANGELOG.md b/owl-bot-staging/google-cloud-redis/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-redis/Gemfile b/owl-bot-staging/google-cloud-redis/Gemfile new file mode 100644 index 000000000000..ab8a61212319 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis/Gemfile @@ -0,0 +1,28 @@ +source "https://rubygems.org" + +gemspec + +local_dependencies = ["google-cloud-redis-v1"] + +main_spec = gemspecs.last || Bundler.load_gemspec(File.join(__dir__, "google-cloud-redis.gemspec")) +local_dependencies.each do |name| + spec_path = File.expand_path "../#{name}/#{name}.gemspec", __dir__ + unless File.file? spec_path + warn "WARNING: Disabled local dependency for #{name} because gemspec not found." + next + end + version = Bundler.load_gemspec(spec_path).version + if main_spec.dependencies.any? { |dep| dep.name == name && !dep.requirement.satisfied_by?(version) } + warn "WARNING: Disabled local dependency for #{name} because the gemspec disallows version #{version}." + next + end + gem name, path: "../#{name}" +end + +gem "google-style", "~> 1.30.1" +gem "minitest", "~> 5.22" +gem "minitest-focus", "~> 1.4" +gem "minitest-rg", "~> 5.3" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-redis/LICENSE.md b/owl-bot-staging/google-cloud-redis/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-redis/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/README.md b/owl-bot-staging/google-cloud-redis/README.md new file mode 100644 index 000000000000..1284375ee42d --- /dev/null +++ b/owl-bot-staging/google-cloud-redis/README.md @@ -0,0 +1,142 @@ +# Ruby Client for the Google Cloud Memorystore for Redis API + +API Client library for the Google Cloud Memorystore for Redis API + +Creates and manages Redis instances on the Google Cloud Platform. + +Actual client classes for the various versions of this API are defined in +_versioned_ client gems, with names of the form `google-cloud-redis-v*`. +The gem `google-cloud-redis` is the main client library that brings the +versioned gems in as dependencies, and provides high-level methods for +constructing clients. More information on versioned clients can be found below +in the section titled *Which client should I use?*. + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-redis/latest) +for this library, google-cloud-redis, to see the convenience methods for +constructing client objects. Reference documentation for the client objects +themselves can be found in the client library documentation for the versioned +client gems: +[google-cloud-redis-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-redis-v1/latest). + +See also the [Product Documentation](https://cloud.google.com/memorystore/docs/redis) +for more usage information. + +## Quick Start + +``` +$ gem install google-cloud-redis +``` + +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) + +```ruby +require "google/cloud/redis" + +client = Google::Cloud::Redis.cloud_redis +request = ::Google::Cloud::Redis::V1::ListInstancesRequest.new # (request fields as keyword arguments...) +response = client.list_instances request +``` + +## 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. + +Debug logging also requires that the versioned clients for this service be +sufficiently recent, released after about Dec 10, 2024. If logging is not +working, try updating the versioned clients in your bundle or installed gems: +[google-cloud-redis-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-redis-v1/latest). + +## 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/Rakefile b/owl-bot-staging/google-cloud-redis/Rakefile new file mode 100644 index 000000000000..fab25f21e041 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis/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 = true +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 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 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 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 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 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-redis" + header "google-cloud-redis rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-redis yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-redis 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 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 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/google-cloud-redis.gemspec b/owl-bot-staging/google-cloud-redis/google-cloud-redis.gemspec new file mode 100644 index 000000000000..fe31ceb853a2 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis/google-cloud-redis.gemspec @@ -0,0 +1,27 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/redis/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-redis" + gem.version = Google::Cloud::Redis::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Creates and manages Redis instances on the Google Cloud Platform." + gem.summary = "API Client library for the Google Cloud Memorystore for Redis 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") + + ["README.md", "AUTHENTICATION.md", "LICENSE.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 3.0" + + gem.add_dependency "google-cloud-core", "~> 1.6" + gem.add_dependency "google-cloud-redis-v1", "~> 2.0" +end diff --git a/owl-bot-staging/google-cloud-redis/lib/google-cloud-redis.rb b/owl-bot-staging/google-cloud-redis/lib/google-cloud-redis.rb new file mode 100644 index 000000000000..24f7f7efe908 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis/lib/google-cloud-redis.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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" unless defined? Google::Cloud::Redis::VERSION diff --git a/owl-bot-staging/google-cloud-redis/lib/google/cloud/redis.rb b/owl-bot-staging/google-cloud-redis/lib/google/cloud/redis.rb new file mode 100644 index 000000000000..538f1afd0136 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis/lib/google/cloud/redis.rb @@ -0,0 +1,170 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# Require this file early so that the version constant gets defined before +# requiring "google/cloud". This is because google-cloud-core will load the +# entrypoint (gem name) file, which in turn re-requires this file (hence +# causing a require cycle) unless the version constant is already defined. +require "google/cloud/redis/version" + +require "googleauth" +gem "google-cloud-core" +require "google/cloud" unless defined? ::Google::Cloud.new +require "google/cloud/config" + +# Set the default configuration +::Google::Cloud.configure.add_config! :redis do |config| + config.add_field! :endpoint, nil, match: ::String + config.add_field! :credentials, nil, match: [::String, ::Hash, ::Google::Auth::Credentials] + config.add_field! :scope, nil, match: [::Array, ::String] + config.add_field! :lib_name, nil, match: ::String + config.add_field! :lib_version, nil, match: ::String + config.add_field! :interceptors, nil, match: ::Array + config.add_field! :timeout, nil, match: ::Numeric + config.add_field! :metadata, nil, match: ::Hash + config.add_field! :retry_policy, nil, match: [::Hash, ::Proc] + config.add_field! :quota_project, nil, match: ::String + config.add_field! :universe_domain, nil, match: ::String +end + +module Google + module Cloud + module Redis + ## + # Create a new client object for CloudRedis. + # + # By default, this returns an instance of + # [Google::Cloud::Redis::V1::CloudRedis::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-redis-v1/latest/Google-Cloud-Redis-V1-CloudRedis-Client) + # for a gRPC client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the CloudRedis service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the CloudRedis service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Redis.cloud_redis_available?}. + # + # ## About 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` + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.cloud_redis version: :v1, transport: :grpc, &block + require "google/cloud/redis/#{version.to_s.downcase}" + + package_name = Google::Cloud::Redis + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Redis.const_get(package_name).const_get(:CloudRedis) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the CloudRedis service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Redis.cloud_redis}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the CloudRedis service, + # or if the versioned client gem needs an update to support the CloudRedis service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.cloud_redis_available? version: :v1, transport: :grpc + require "google/cloud/redis/#{version.to_s.downcase}" + package_name = Google::Cloud::Redis + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Redis.const_get package_name + return false unless service_module.const_defined? :CloudRedis + service_module = service_module.const_get :CloudRedis + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Configure the google-cloud-redis library. + # + # The following configuration parameters are supported: + # + # * `credentials` (*type:* `String, Hash, Google::Auth::Credentials`) - + # The path to the keyfile as a String, the contents of the keyfile as a + # Hash, or a Google::Auth::Credentials object. + # * `lib_name` (*type:* `String`) - + # The library name as recorded in instrumentation and logging. + # * `lib_version` (*type:* `String`) - + # The library version as recorded in instrumentation and logging. + # * `interceptors` (*type:* `Array`) - + # An array of interceptors that are run before calls are executed. + # * `timeout` (*type:* `Numeric`) - + # Default timeout in seconds. + # * `metadata` (*type:* `Hash{Symbol=>String}`) - + # Additional headers to be sent with the call. + # * `retry_policy` (*type:* `Hash`) - + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - + # The error codes that should trigger a retry. + # + # @return [::Google::Cloud::Config] The default configuration used by this library + # + def self.configure + yield ::Google::Cloud.configure.redis if block_given? + + ::Google::Cloud.configure.redis + end + end + end +end + +helper_path = ::File.join __dir__, "redis", "helpers.rb" +require "google/cloud/redis/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-redis/lib/google/cloud/redis/version.rb b/owl-bot-staging/google-cloud-redis/lib/google/cloud/redis/version.rb new file mode 100644 index 000000000000..cd614cdb85fc --- /dev/null +++ b/owl-bot-staging/google-cloud-redis/lib/google/cloud/redis/version.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! + + +module Google + module Cloud + module Redis + VERSION = "0.0.1" + end + end +end diff --git a/owl-bot-staging/google-cloud-redis/test/google/cloud/redis/client_test.rb b/owl-bot-staging/google-cloud-redis/test/google/cloud/redis/client_test.rb new file mode 100644 index 000000000000..73cd355f4744 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis/test/google/cloud/redis/client_test.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 "helper" +require "google/cloud/redis" +require "gapic/common" +require "gapic/grpc" +require "gapic/rest" + +class Google::Cloud::Redis::ClientConstructionMinitest < 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_cloud_redis_grpc + skip unless Google::Cloud::Redis.cloud_redis_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::Redis.cloud_redis transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::Redis::V1::CloudRedis::Client, client + end + end + + def test_cloud_redis_rest + skip unless Google::Cloud::Redis.cloud_redis_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Redis.cloud_redis transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Redis::V1::CloudRedis::Rest::Client, client + end + end +end diff --git a/owl-bot-staging/google-cloud-redis/test/google/cloud/redis/version_test.rb b/owl-bot-staging/google-cloud-redis/test/google/cloud/redis/version_test.rb new file mode 100644 index 000000000000..d762219f9508 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis/test/google/cloud/redis/version_test.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 "helper" +require "google/cloud/redis/version" + +class Google::Cloud::Redis::VersionMinitest < Minitest::Test + def test_has_a_version + refute_nil Google::Cloud::Redis::VERSION + end +end diff --git a/owl-bot-staging/google-cloud-redis/test/helper.rb b/owl-bot-staging/google-cloud-redis/test/helper.rb new file mode 100644 index 000000000000..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-redis/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" + +require "ostruct" 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..6442df18fa2f --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/Gemfile @@ -0,0 +1,11 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.31.1" +gem "minitest", "~> 5.22" +gem "minitest-focus", "~> 1.4" +gem "minitest-rg", "~> 5.3" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-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..b8d6ae64be9d --- /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.1" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.add_dependency "grpc-google-iam-v1", "~> 1.11" +end diff --git a/owl-bot-staging/google-cloud-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..57454e79f8d4 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/folders_pb.rb @@ -0,0 +1,70 @@ +# 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 + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module 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..2032cfd00f73 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/organizations_pb.rb @@ -0,0 +1,57 @@ +# 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 + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module 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..2d27364f0117 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/projects_pb.rb @@ -0,0 +1,70 @@ +# 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 + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module 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..804f1bf575ec --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_bindings_pb.rb @@ -0,0 +1,58 @@ +# 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 + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module 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..d4eb3804ad3c --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_holds_pb.rb @@ -0,0 +1,57 @@ +# 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 + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module 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..ba87d6366407 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_keys_pb.rb @@ -0,0 +1,65 @@ +# 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 + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module 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..027b74c11421 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_values_pb.rb @@ -0,0 +1,64 @@ +# 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 + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module 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..d59ba51a5612 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/api/client.rb @@ -0,0 +1,473 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] experimental_features + # @return [::Google::Api::PythonSettings::ExperimentalFeatures] + # Experimental features to be included during client library generation. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Experimental features to be included during client library generation. + # These fields will be deprecated once the feature graduates and is enabled + # by default. + # @!attribute [rw] rest_async_io_enabled + # @return [::Boolean] + # Enables generation of asynchronous REST clients if `rest` transport is + # enabled. By default, asynchronous REST clients will not be generated. + # This feature will be enabled by default 1 month after launching the + # feature in preview packages. + # @!attribute [rw] protobuf_pythonic_types_enabled + # @return [::Boolean] + # Enables generation of protobuf code using new types that are more + # Pythonic which are included in `protobuf>=5.29.x`. This feature will be + # enabled by default 1 month after launching the feature in preview + # packages. + # @!attribute [rw] unversioned_package_disabled + # @return [::Boolean] + # Disables generation of an unversioned Python package for this client + # library. This means that the module names will need to be versioned in + # import statements. For example `import google.cloud.library_v2` instead + # of `import google.cloud.library`. + class ExperimentalFeatures + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map of service names to renamed services. Keys are the package relative + # service names and values are the name to be used for the service client + # and call options. + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # + # Example: + # + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # This message is used to configure the generation of a subset of the RPCs in + # a service for client libraries. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/owl-bot-staging/google-cloud-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..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager-v3/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" + +require "ostruct" diff --git a/owl-bot-staging/google-cloud-resource_manager/.gitignore b/owl-bot-staging/google-cloud-resource_manager/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager/.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/.repo-metadata.json b/owl-bot-staging/google-cloud-resource_manager/.repo-metadata.json new file mode 100644 index 000000000000..8a72b65aaf7b --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager/.repo-metadata.json @@ -0,0 +1,15 @@ +{ + "api_id": "cloudresourcemanager.googleapis.com", + "api_shortname": "cloudresourcemanager", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-resource_manager/latest", + "distribution_name": "google-cloud-resource_manager", + "is_cloud": true, + "language": "ruby", + "name": "cloudresourcemanager", + "name_pretty": "Cloud Resource Manager API", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Creates, reads, and updates metadata for Google Cloud Platform resource containers.", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-resource_manager/.rubocop.yml b/owl-bot-staging/google-cloud-resource_manager/.rubocop.yml new file mode 100644 index 000000000000..38e7ef0201f0 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager/.rubocop.yml @@ -0,0 +1,39 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-resource_manager.gemspec" + - "Rakefile" + - "acceptance/**/*" + - "test/**/*" + +Bundler/OrderedGems: + Enabled: false +Documentation: + Enabled: false +Layout/LineLength: + Enabled: false +Metrics/BlockLength: + Exclude: + - "samples/**/acceptance/*.rb" +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/FileName: + Exclude: + - "lib/google-cloud-resource_manager.rb" + +Style/BlockDelimiters: + Exclude: + - "samples/**/acceptance/*.rb" diff --git a/owl-bot-staging/google-cloud-resource_manager/.toys.rb b/owl-bot-staging/google-cloud-resource_manager/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager/.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/.yardopts b/owl-bot-staging/google-cloud-resource_manager/.yardopts new file mode 100644 index 000000000000..f33dd0accdd3 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Cloud Resource Manager API" +--exclude _pb\.rb$ +--markup markdown +--markup-provider redcarpet + +./lib/**/*.rb +- +README.md +AUTHENTICATION.md +MIGRATING.md +LICENSE.md diff --git a/owl-bot-staging/google-cloud-resource_manager/AUTHENTICATION.md b/owl-bot-staging/google-cloud-resource_manager/AUTHENTICATION.md new file mode 100644 index 000000000000..a0127ab5179c --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-resource_manager 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 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" + +client = Google::Cloud::ResourceManager.folders do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/resource_manager" + +Google::Cloud::ResourceManager.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = Google::Cloud::ResourceManager.folders +``` + +### 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 +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" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = Google::Cloud::ResourceManager.folders +``` + +### 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/CHANGELOG.md b/owl-bot-staging/google-cloud-resource_manager/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-resource_manager/Gemfile b/owl-bot-staging/google-cloud-resource_manager/Gemfile new file mode 100644 index 000000000000..bd424fdd9c48 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager/Gemfile @@ -0,0 +1,28 @@ +source "https://rubygems.org" + +gemspec + +local_dependencies = ["google-cloud-resource_manager-v3"] + +main_spec = gemspecs.last || Bundler.load_gemspec(File.join(__dir__, "google-cloud-resource_manager.gemspec")) +local_dependencies.each do |name| + spec_path = File.expand_path "../#{name}/#{name}.gemspec", __dir__ + unless File.file? spec_path + warn "WARNING: Disabled local dependency for #{name} because gemspec not found." + next + end + version = Bundler.load_gemspec(spec_path).version + if main_spec.dependencies.any? { |dep| dep.name == name && !dep.requirement.satisfied_by?(version) } + warn "WARNING: Disabled local dependency for #{name} because the gemspec disallows version #{version}." + next + end + gem name, path: "../#{name}" +end + +gem "google-style", "~> 1.30.1" +gem "minitest", "~> 5.22" +gem "minitest-focus", "~> 1.4" +gem "minitest-rg", "~> 5.3" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-resource_manager/LICENSE.md b/owl-bot-staging/google-cloud-resource_manager/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager/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/README.md b/owl-bot-staging/google-cloud-resource_manager/README.md new file mode 100644 index 000000000000..7fb718e3aac5 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager/README.md @@ -0,0 +1,147 @@ +# Ruby Client for the Cloud Resource Manager API + +Creates, reads, and updates metadata for Google Cloud Platform resource containers. + +Creates, reads, and updates metadata for Google Cloud Platform resource containers. + +Actual client classes for the various versions of this API are defined in +_versioned_ client gems, with names of the form `google-cloud-resource_manager-v*`. +The gem `google-cloud-resource_manager` is the main client library that brings the +versioned gems in as dependencies, and provides high-level methods for +constructing clients. More information on versioned clients can be found below +in the section titled *Which client should I use?*. + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-resource_manager/latest) +for this library, google-cloud-resource_manager, to see the convenience methods for +constructing client objects. Reference documentation for the client objects +themselves can be found in the client library documentation for the versioned +client gems: +[google-cloud-resource_manager-v3](https://cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest). + +## Quick Start + +``` +$ gem install google-cloud-resource_manager +``` + +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) + +```ruby +require "google/cloud/resource_manager" + +client = Google::Cloud::ResourceManager.folders +request = ::Google::Cloud::ResourceManager::V3::GetFolderRequest.new # (request fields as keyword arguments...) +response = client.get_folder request +``` + +## Migrating from 0.x versions + +The 1.0 release of the google-cloud-resource_manager client is a significant upgrade +based on a [next-gen code generator](https://github.com/googleapis/gapic-generator-ruby), +and includes substantial interface changes. Existing code written for earlier +versions of this library will likely require updates to use this version. +See the {file:MIGRATING.md MIGRATING.md} document for more 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. + +Debug logging also requires that the versioned clients for this service be +sufficiently recent, released after about Dec 10, 2024. If logging is not +working, try updating the versioned clients in your bundle or installed gems: +[google-cloud-resource_manager-v3](https://cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest). + +## 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/Rakefile b/owl-bot-staging/google-cloud-resource_manager/Rakefile new file mode 100644 index 000000000000..46ca31bfc501 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager/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 = true +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 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/resource_manager/v3/folders/credentials" + ::Google::Cloud::ResourceManager::V3::Folders::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-resource_manager 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 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 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 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-resource_manager" + header "google-cloud-resource_manager rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-resource_manager yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-resource_manager 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 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 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/google-cloud-resource_manager.gemspec b/owl-bot-staging/google-cloud-resource_manager/google-cloud-resource_manager.gemspec new file mode 100644 index 000000000000..c4e13b52f47f --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager/google-cloud-resource_manager.gemspec @@ -0,0 +1,27 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/resource_manager/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-resource_manager" + gem.version = Google::Cloud::ResourceManager::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Creates, reads, and updates metadata for Google Cloud Platform resource containers." + 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") + + ["README.md", "AUTHENTICATION.md", "LICENSE.md", ".yardopts", "MIGRATING.md"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 3.0" + + gem.add_dependency "google-cloud-core", "~> 1.6" + gem.add_dependency "google-cloud-resource_manager-v3", "~> 1.2" +end diff --git a/owl-bot-staging/google-cloud-resource_manager/lib/google-cloud-resource_manager.rb b/owl-bot-staging/google-cloud-resource_manager/lib/google-cloud-resource_manager.rb new file mode 100644 index 000000000000..a17c3b857361 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager/lib/google-cloud-resource_manager.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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" unless defined? Google::Cloud::ResourceManager::VERSION diff --git a/owl-bot-staging/google-cloud-resource_manager/lib/google/cloud/resource_manager.rb b/owl-bot-staging/google-cloud-resource_manager/lib/google/cloud/resource_manager.rb new file mode 100644 index 000000000000..763710153ab8 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager/lib/google/cloud/resource_manager.rb @@ -0,0 +1,583 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# Require this file early so that the version constant gets defined before +# requiring "google/cloud". This is because google-cloud-core will load the +# entrypoint (gem name) file, which in turn re-requires this file (hence +# causing a require cycle) unless the version constant is already defined. +require "google/cloud/resource_manager/version" + +require "googleauth" +gem "google-cloud-core" +require "google/cloud" unless defined? ::Google::Cloud.new +require "google/cloud/config" + +# Set the default configuration +::Google::Cloud.configure.add_config! :resource_manager do |config| + config.add_field! :endpoint, nil, match: ::String + config.add_field! :credentials, nil, match: [::String, ::Hash, ::Google::Auth::Credentials] + config.add_field! :scope, nil, match: [::Array, ::String] + config.add_field! :lib_name, nil, match: ::String + config.add_field! :lib_version, nil, match: ::String + config.add_field! :interceptors, nil, match: ::Array + config.add_field! :timeout, nil, match: ::Numeric + config.add_field! :metadata, nil, match: ::Hash + config.add_field! :retry_policy, nil, match: [::Hash, ::Proc] + config.add_field! :quota_project, nil, match: ::String + config.add_field! :universe_domain, nil, match: ::String +end + +module Google + module Cloud + module ResourceManager + ## + # Create a new client object for Folders. + # + # By default, this returns an instance of + # [Google::Cloud::ResourceManager::V3::Folders::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Cloud-ResourceManager-V3-Folders-Client) + # for a gRPC client for version V3 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the Folders service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the Folders service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::ResourceManager.folders_available?}. + # + # ## About 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. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v3`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.folders version: :v3, transport: :grpc, &block + require "google/cloud/resource_manager/#{version.to_s.downcase}" + + package_name = Google::Cloud::ResourceManager + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::ResourceManager.const_get(package_name).const_get(:Folders) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the Folders service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::ResourceManager.folders}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the Folders service, + # or if the versioned client gem needs an update to support the Folders service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v3`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.folders_available? version: :v3, transport: :grpc + require "google/cloud/resource_manager/#{version.to_s.downcase}" + package_name = Google::Cloud::ResourceManager + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::ResourceManager.const_get package_name + return false unless service_module.const_defined? :Folders + service_module = service_module.const_get :Folders + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for Organizations. + # + # By default, this returns an instance of + # [Google::Cloud::ResourceManager::V3::Organizations::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Cloud-ResourceManager-V3-Organizations-Client) + # for a gRPC client for version V3 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the Organizations service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the Organizations service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::ResourceManager.organizations_available?}. + # + # ## About Organizations + # + # Allows users to manage their organization resources. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v3`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.organizations version: :v3, transport: :grpc, &block + require "google/cloud/resource_manager/#{version.to_s.downcase}" + + package_name = Google::Cloud::ResourceManager + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::ResourceManager.const_get(package_name).const_get(:Organizations) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the Organizations service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::ResourceManager.organizations}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the Organizations service, + # or if the versioned client gem needs an update to support the Organizations service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v3`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.organizations_available? version: :v3, transport: :grpc + require "google/cloud/resource_manager/#{version.to_s.downcase}" + package_name = Google::Cloud::ResourceManager + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::ResourceManager.const_get package_name + return false unless service_module.const_defined? :Organizations + service_module = service_module.const_get :Organizations + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for Projects. + # + # By default, this returns an instance of + # [Google::Cloud::ResourceManager::V3::Projects::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Cloud-ResourceManager-V3-Projects-Client) + # for a gRPC client for version V3 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the Projects service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the Projects service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::ResourceManager.projects_available?}. + # + # ## About Projects + # + # Manages Google Cloud Projects. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v3`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.projects version: :v3, transport: :grpc, &block + require "google/cloud/resource_manager/#{version.to_s.downcase}" + + package_name = Google::Cloud::ResourceManager + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::ResourceManager.const_get(package_name).const_get(:Projects) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the Projects service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::ResourceManager.projects}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the Projects service, + # or if the versioned client gem needs an update to support the Projects service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v3`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.projects_available? version: :v3, transport: :grpc + require "google/cloud/resource_manager/#{version.to_s.downcase}" + package_name = Google::Cloud::ResourceManager + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::ResourceManager.const_get package_name + return false unless service_module.const_defined? :Projects + service_module = service_module.const_get :Projects + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for TagBindings. + # + # By default, this returns an instance of + # [Google::Cloud::ResourceManager::V3::TagBindings::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Cloud-ResourceManager-V3-TagBindings-Client) + # for a gRPC client for version V3 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the TagBindings service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the TagBindings service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::ResourceManager.tag_bindings_available?}. + # + # ## About TagBindings + # + # Allow users to create and manage TagBindings between TagValues and + # different Google Cloud resources throughout the GCP resource hierarchy. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v3`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.tag_bindings version: :v3, transport: :grpc, &block + require "google/cloud/resource_manager/#{version.to_s.downcase}" + + package_name = Google::Cloud::ResourceManager + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::ResourceManager.const_get(package_name).const_get(:TagBindings) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the TagBindings service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::ResourceManager.tag_bindings}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the TagBindings service, + # or if the versioned client gem needs an update to support the TagBindings service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v3`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.tag_bindings_available? version: :v3, transport: :grpc + require "google/cloud/resource_manager/#{version.to_s.downcase}" + package_name = Google::Cloud::ResourceManager + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::ResourceManager.const_get package_name + return false unless service_module.const_defined? :TagBindings + service_module = service_module.const_get :TagBindings + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for TagHolds. + # + # By default, this returns an instance of + # [Google::Cloud::ResourceManager::V3::TagHolds::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Cloud-ResourceManager-V3-TagHolds-Client) + # for a gRPC client for version V3 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the TagHolds service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the TagHolds service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::ResourceManager.tag_holds_available?}. + # + # ## About 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. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v3`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.tag_holds version: :v3, transport: :grpc, &block + require "google/cloud/resource_manager/#{version.to_s.downcase}" + + package_name = Google::Cloud::ResourceManager + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::ResourceManager.const_get(package_name).const_get(:TagHolds) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the TagHolds service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::ResourceManager.tag_holds}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the TagHolds service, + # or if the versioned client gem needs an update to support the TagHolds service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v3`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.tag_holds_available? version: :v3, transport: :grpc + require "google/cloud/resource_manager/#{version.to_s.downcase}" + package_name = Google::Cloud::ResourceManager + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::ResourceManager.const_get package_name + return false unless service_module.const_defined? :TagHolds + service_module = service_module.const_get :TagHolds + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for TagKeys. + # + # By default, this returns an instance of + # [Google::Cloud::ResourceManager::V3::TagKeys::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Cloud-ResourceManager-V3-TagKeys-Client) + # for a gRPC client for version V3 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the TagKeys service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the TagKeys service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::ResourceManager.tag_keys_available?}. + # + # ## About TagKeys + # + # Allow users to create and manage tag keys. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v3`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.tag_keys version: :v3, transport: :grpc, &block + require "google/cloud/resource_manager/#{version.to_s.downcase}" + + package_name = Google::Cloud::ResourceManager + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::ResourceManager.const_get(package_name).const_get(:TagKeys) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the TagKeys service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::ResourceManager.tag_keys}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the TagKeys service, + # or if the versioned client gem needs an update to support the TagKeys service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v3`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.tag_keys_available? version: :v3, transport: :grpc + require "google/cloud/resource_manager/#{version.to_s.downcase}" + package_name = Google::Cloud::ResourceManager + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::ResourceManager.const_get package_name + return false unless service_module.const_defined? :TagKeys + service_module = service_module.const_get :TagKeys + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for TagValues. + # + # By default, this returns an instance of + # [Google::Cloud::ResourceManager::V3::TagValues::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Cloud-ResourceManager-V3-TagValues-Client) + # for a gRPC client for version V3 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the TagValues service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the TagValues service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::ResourceManager.tag_values_available?}. + # + # ## About TagValues + # + # Allow users to create and manage tag values. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v3`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.tag_values version: :v3, transport: :grpc, &block + require "google/cloud/resource_manager/#{version.to_s.downcase}" + + package_name = Google::Cloud::ResourceManager + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::ResourceManager.const_get(package_name).const_get(:TagValues) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the TagValues service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::ResourceManager.tag_values}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the TagValues service, + # or if the versioned client gem needs an update to support the TagValues service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v3`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.tag_values_available? version: :v3, transport: :grpc + require "google/cloud/resource_manager/#{version.to_s.downcase}" + package_name = Google::Cloud::ResourceManager + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::ResourceManager.const_get package_name + return false unless service_module.const_defined? :TagValues + service_module = service_module.const_get :TagValues + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Configure the google-cloud-resource_manager library. + # + # The following configuration parameters are supported: + # + # * `credentials` (*type:* `String, Hash, Google::Auth::Credentials`) - + # The path to the keyfile as a String, the contents of the keyfile as a + # Hash, or a Google::Auth::Credentials object. + # * `lib_name` (*type:* `String`) - + # The library name as recorded in instrumentation and logging. + # * `lib_version` (*type:* `String`) - + # The library version as recorded in instrumentation and logging. + # * `interceptors` (*type:* `Array`) - + # An array of interceptors that are run before calls are executed. + # * `timeout` (*type:* `Numeric`) - + # Default timeout in seconds. + # * `metadata` (*type:* `Hash{Symbol=>String}`) - + # Additional headers to be sent with the call. + # * `retry_policy` (*type:* `Hash`) - + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - + # The error codes that should trigger a retry. + # + # @return [::Google::Cloud::Config] The default configuration used by this library + # + def self.configure + yield ::Google::Cloud.configure.resource_manager if block_given? + + ::Google::Cloud.configure.resource_manager + end + end + end +end + +helper_path = ::File.join __dir__, "resource_manager", "helpers.rb" +require "google/cloud/resource_manager/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-resource_manager/lib/google/cloud/resource_manager/version.rb b/owl-bot-staging/google-cloud-resource_manager/lib/google/cloud/resource_manager/version.rb new file mode 100644 index 000000000000..cc2ec91f9504 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager/lib/google/cloud/resource_manager/version.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! + + +module Google + module Cloud + module ResourceManager + VERSION = "0.0.1" + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager/test/google/cloud/resource_manager/client_test.rb b/owl-bot-staging/google-cloud-resource_manager/test/google/cloud/resource_manager/client_test.rb new file mode 100644 index 000000000000..76d471122b3a --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager/test/google/cloud/resource_manager/client_test.rb @@ -0,0 +1,190 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "google/cloud/resource_manager" +require "gapic/common" +require "gapic/grpc" +require "gapic/rest" + +class Google::Cloud::ResourceManager::ClientConstructionMinitest < 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_folders_grpc + skip unless Google::Cloud::ResourceManager.folders_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::ResourceManager.folders transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::ResourceManager::V3::Folders::Client, client + end + end + + def test_folders_rest + skip unless Google::Cloud::ResourceManager.folders_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::ResourceManager.folders transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::ResourceManager::V3::Folders::Rest::Client, client + end + end + + def test_organizations_grpc + skip unless Google::Cloud::ResourceManager.organizations_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::ResourceManager.organizations transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::ResourceManager::V3::Organizations::Client, client + end + end + + def test_organizations_rest + skip unless Google::Cloud::ResourceManager.organizations_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::ResourceManager.organizations transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::ResourceManager::V3::Organizations::Rest::Client, client + end + end + + def test_projects_grpc + skip unless Google::Cloud::ResourceManager.projects_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::ResourceManager.projects transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::ResourceManager::V3::Projects::Client, client + end + end + + def test_projects_rest + skip unless Google::Cloud::ResourceManager.projects_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::ResourceManager.projects transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::ResourceManager::V3::Projects::Rest::Client, client + end + end + + def test_tag_bindings_grpc + skip unless Google::Cloud::ResourceManager.tag_bindings_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::ResourceManager.tag_bindings transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::ResourceManager::V3::TagBindings::Client, client + end + end + + def test_tag_bindings_rest + skip unless Google::Cloud::ResourceManager.tag_bindings_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::ResourceManager.tag_bindings transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::ResourceManager::V3::TagBindings::Rest::Client, client + end + end + + def test_tag_holds_grpc + skip unless Google::Cloud::ResourceManager.tag_holds_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::ResourceManager.tag_holds transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::ResourceManager::V3::TagHolds::Client, client + end + end + + def test_tag_holds_rest + skip unless Google::Cloud::ResourceManager.tag_holds_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::ResourceManager.tag_holds transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::ResourceManager::V3::TagHolds::Rest::Client, client + end + end + + def test_tag_keys_grpc + skip unless Google::Cloud::ResourceManager.tag_keys_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::ResourceManager.tag_keys transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::ResourceManager::V3::TagKeys::Client, client + end + end + + def test_tag_keys_rest + skip unless Google::Cloud::ResourceManager.tag_keys_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::ResourceManager.tag_keys transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::ResourceManager::V3::TagKeys::Rest::Client, client + end + end + + def test_tag_values_grpc + skip unless Google::Cloud::ResourceManager.tag_values_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::ResourceManager.tag_values transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::ResourceManager::V3::TagValues::Client, client + end + end + + def test_tag_values_rest + skip unless Google::Cloud::ResourceManager.tag_values_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::ResourceManager.tag_values transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::ResourceManager::V3::TagValues::Rest::Client, client + end + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager/test/google/cloud/resource_manager/version_test.rb b/owl-bot-staging/google-cloud-resource_manager/test/google/cloud/resource_manager/version_test.rb new file mode 100644 index 000000000000..23c8cdbe40ca --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager/test/google/cloud/resource_manager/version_test.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 "helper" +require "google/cloud/resource_manager/version" + +class Google::Cloud::ResourceManager::VersionMinitest < Minitest::Test + def test_has_a_version + refute_nil Google::Cloud::ResourceManager::VERSION + end +end diff --git a/owl-bot-staging/google-cloud-resource_manager/test/helper.rb b/owl-bot-staging/google-cloud-resource_manager/test/helper.rb new file mode 100644 index 000000000000..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-resource_manager/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" + +require "ostruct" 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..6442df18fa2f --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/Gemfile @@ -0,0 +1,11 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.31.1" +gem "minitest", "~> 5.22" +gem "minitest-focus", "~> 1.4" +gem "minitest-rg", "~> 5.3" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-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..602bd7251faf --- /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.1" + + 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..09c6e9129bf1 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service_pb.rb @@ -0,0 +1,48 @@ +# 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 + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module 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..143124a08f0b --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_pb.rb @@ -0,0 +1,66 @@ +# 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 + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.retail.v2.Interval", "google/cloud/retail/v2/common.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.cloud.retail.v2.CompletionDataInputConfig", "google/cloud/retail/v2/import_config.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module 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..15a326b8a013 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_service_pb.rb @@ -0,0 +1,66 @@ +# 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 + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.retail.v2.Catalog", "google/cloud/retail/v2/catalog.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module 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..abb3ef319229 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/common_pb.rb @@ -0,0 +1,80 @@ +# 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 + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module 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..6bf97105b323 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service_pb.rb @@ -0,0 +1,55 @@ +# 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 + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.retail.v2.CustomAttribute", "google/cloud/retail/v2/common.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module 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..5a6d76c31509 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_pb.rb @@ -0,0 +1,47 @@ +# 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 + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.retail.v2.Rule", "google/cloud/retail/v2/common.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module 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..6e0e44e8fb45 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_service_pb.rb @@ -0,0 +1,57 @@ +# 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 + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.retail.v2.Control", "google/cloud/retail/v2/control.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module 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..41c473ddbc80 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service_pb.rb @@ -0,0 +1,65 @@ +# 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 + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.retail.v2.UserInfo", "google/cloud/retail/v2/common.proto"], + ["google.cloud.retail.v2.SafetySetting", "google/cloud/retail/v2/safety.proto"], + ["google.cloud.retail.v2.SearchRequest.BoostSpec", "google/cloud/retail/v2/search_service.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module 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..7d3a69e64319 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/export_config_pb.rb @@ -0,0 +1,58 @@ +# 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 + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module 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..53a9e3a0d3a8 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_pb.rb @@ -0,0 +1,45 @@ +# 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 + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module 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..104d4e7fba36 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_service_pb.rb @@ -0,0 +1,57 @@ +# 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 + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.retail.v2.GenerativeQuestionsFeatureConfig", "google/cloud/retail/v2/generative_question.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module 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..d6b726bbbf59 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/import_config_pb.rb @@ -0,0 +1,73 @@ +# 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 + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.type.Date", "google/type/date.proto"], + ["google.cloud.retail.v2.Product", "google/cloud/retail/v2/product.proto"], + ["google.cloud.retail.v2.UserEvent", "google/cloud/retail/v2/user_event.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module 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..02e51a0dafa7 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_pb.rb @@ -0,0 +1,56 @@ +# 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 + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module 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..d3352f587ea6 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service_pb.rb @@ -0,0 +1,64 @@ +# 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..f2c254e3ab5a --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service_pb.rb @@ -0,0 +1,53 @@ +# 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 + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.retail.v2.UserEvent", "google/cloud/retail/v2/user_event.proto"], + ["google.protobuf.Value", "google/protobuf/struct.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module 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..c56b602cfb68 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_pb.rb @@ -0,0 +1,59 @@ +# 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 + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.protobuf.Duration", "google/protobuf/duration.proto"], + ["google.cloud.retail.v2.PriceInfo", "google/cloud/retail/v2/common.proto"], + ["google.protobuf.Int32Value", "google/protobuf/wrappers.proto"], + ["google.cloud.retail.v2.Promotion", "google/cloud/retail/v2/promotion.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module 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..9893d96639fa --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service_pb.rb @@ -0,0 +1,79 @@ +# 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 + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.retail.v2.Product", "google/cloud/retail/v2/product.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.cloud.retail.v2.LocalInventory", "google/cloud/retail/v2/common.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module 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..4e31e296de19 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/promotion_pb.rb @@ -0,0 +1,42 @@ +# 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 + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module 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..e141395dee6a --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/purge_config_pb.rb @@ -0,0 +1,52 @@ +# 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 + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module 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..f4a296baa3c5 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/safety_pb.rb @@ -0,0 +1,47 @@ +# 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 + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module 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..4ff8ca5ba66d --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service_pb.rb @@ -0,0 +1,86 @@ +# 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 + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.retail.v2.Interval", "google/cloud/retail/v2/common.proto"], + ["google.cloud.retail.v2.Product", "google/cloud/retail/v2/product.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.protobuf.Value", "google/protobuf/struct.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module 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..57b5608c7710 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_pb.rb @@ -0,0 +1,49 @@ +# 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 + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.retail.v2.SearchRequest.DynamicFacetSpec", "google/cloud/retail/v2/search_service.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module 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..90c9627de012 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service_pb.rb @@ -0,0 +1,59 @@ +# 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 + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.retail.v2.ServingConfig", "google/cloud/retail/v2/serving_config.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module 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..5c8773051ad8 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_pb.rb @@ -0,0 +1,55 @@ +# 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 + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.cloud.retail.v2.UserInfo", "google/cloud/retail/v2/common.proto"], + ["google.cloud.retail.v2.Product", "google/cloud/retail/v2/product.proto"], + ["google.protobuf.Int32Value", "google/protobuf/wrappers.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module 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..684f9413331a --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service_pb.rb @@ -0,0 +1,58 @@ +# 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 + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.retail.v2.UserEvent", "google/cloud/retail/v2/user_event.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module 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..d59ba51a5612 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/api/client.rb @@ -0,0 +1,473 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] experimental_features + # @return [::Google::Api::PythonSettings::ExperimentalFeatures] + # Experimental features to be included during client library generation. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Experimental features to be included during client library generation. + # These fields will be deprecated once the feature graduates and is enabled + # by default. + # @!attribute [rw] rest_async_io_enabled + # @return [::Boolean] + # Enables generation of asynchronous REST clients if `rest` transport is + # enabled. By default, asynchronous REST clients will not be generated. + # This feature will be enabled by default 1 month after launching the + # feature in preview packages. + # @!attribute [rw] protobuf_pythonic_types_enabled + # @return [::Boolean] + # Enables generation of protobuf code using new types that are more + # Pythonic which are included in `protobuf>=5.29.x`. This feature will be + # enabled by default 1 month after launching the feature in preview + # packages. + # @!attribute [rw] unversioned_package_disabled + # @return [::Boolean] + # Disables generation of an unversioned Python package for this client + # library. This means that the module names will need to be versioned in + # import statements. For example `import google.cloud.library_v2` instead + # of `import google.cloud.library`. + class ExperimentalFeatures + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map of service names to renamed services. Keys are the package relative + # service names and values are the name to be used for the service client + # and call options. + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # + # Example: + # + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # This message is used to configure the generation of a subset of the RPCs in + # a service for client libraries. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/owl-bot-staging/google-cloud-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..1b485b0c3456 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/protobuf/wrappers.rb @@ -0,0 +1,121 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # Wrapper message for `double`. + # + # The JSON representation for `DoubleValue` is JSON number. + # @!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. + # @!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. + # @!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. + # @!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. + # @!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. + # @!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`. + # @!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. + # @!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. + # @!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..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail-v2/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" + +require "ostruct" diff --git a/owl-bot-staging/google-cloud-retail/.gitignore b/owl-bot-staging/google-cloud-retail/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-retail/.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/.repo-metadata.json b/owl-bot-staging/google-cloud-retail/.repo-metadata.json new file mode 100644 index 000000000000..0bc7656977aa --- /dev/null +++ b/owl-bot-staging/google-cloud-retail/.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/latest", + "distribution_name": "google-cloud-retail", + "is_cloud": true, + "language": "ruby", + "name": "retail", + "name_pretty": "Retail 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.", + "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/.rubocop.yml b/owl-bot-staging/google-cloud-retail/.rubocop.yml new file mode 100644 index 000000000000..bc5a32420f48 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail/.rubocop.yml @@ -0,0 +1,39 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-retail.gemspec" + - "Rakefile" + - "acceptance/**/*" + - "test/**/*" + +Bundler/OrderedGems: + Enabled: false +Documentation: + Enabled: false +Layout/LineLength: + Enabled: false +Metrics/BlockLength: + Exclude: + - "samples/**/acceptance/*.rb" +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/FileName: + Exclude: + - "lib/google-cloud-retail.rb" + +Style/BlockDelimiters: + Exclude: + - "samples/**/acceptance/*.rb" diff --git a/owl-bot-staging/google-cloud-retail/.toys.rb b/owl-bot-staging/google-cloud-retail/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-retail/.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/.yardopts b/owl-bot-staging/google-cloud-retail/.yardopts new file mode 100644 index 000000000000..b19814d452b7 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail/.yardopts @@ -0,0 +1,11 @@ +--no-private +--title="Retail API" +--exclude _pb\.rb$ +--markup markdown +--markup-provider redcarpet + +./lib/**/*.rb +- +README.md +AUTHENTICATION.md +LICENSE.md diff --git a/owl-bot-staging/google-cloud-retail/AUTHENTICATION.md b/owl-bot-staging/google-cloud-retail/AUTHENTICATION.md new file mode 100644 index 000000000000..ad65e919dc19 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-retail 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 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" + +client = Google::Cloud::Retail.analytics_service do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/retail" + +Google::Cloud::Retail.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = Google::Cloud::Retail.analytics_service +``` + +### 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 +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" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = Google::Cloud::Retail.analytics_service +``` + +### 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/CHANGELOG.md b/owl-bot-staging/google-cloud-retail/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-retail/Gemfile b/owl-bot-staging/google-cloud-retail/Gemfile new file mode 100644 index 000000000000..9b0b2f3ff744 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail/Gemfile @@ -0,0 +1,28 @@ +source "https://rubygems.org" + +gemspec + +local_dependencies = ["google-cloud-retail-v2"] + +main_spec = gemspecs.last || Bundler.load_gemspec(File.join(__dir__, "google-cloud-retail.gemspec")) +local_dependencies.each do |name| + spec_path = File.expand_path "../#{name}/#{name}.gemspec", __dir__ + unless File.file? spec_path + warn "WARNING: Disabled local dependency for #{name} because gemspec not found." + next + end + version = Bundler.load_gemspec(spec_path).version + if main_spec.dependencies.any? { |dep| dep.name == name && !dep.requirement.satisfied_by?(version) } + warn "WARNING: Disabled local dependency for #{name} because the gemspec disallows version #{version}." + next + end + gem name, path: "../#{name}" +end + +gem "google-style", "~> 1.30.1" +gem "minitest", "~> 5.22" +gem "minitest-focus", "~> 1.4" +gem "minitest-rg", "~> 5.3" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-retail/LICENSE.md b/owl-bot-staging/google-cloud-retail/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-retail/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/README.md b/owl-bot-staging/google-cloud-retail/README.md new file mode 100644 index 000000000000..ba0a543827bc --- /dev/null +++ b/owl-bot-staging/google-cloud-retail/README.md @@ -0,0 +1,142 @@ +# Ruby Client for the Retail API + +API Client library for the Retail API + +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. + +Actual client classes for the various versions of this API are defined in +_versioned_ client gems, with names of the form `google-cloud-retail-v*`. +The gem `google-cloud-retail` is the main client library that brings the +versioned gems in as dependencies, and provides high-level methods for +constructing clients. More information on versioned clients can be found below +in the section titled *Which client should I use?*. + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-retail/latest) +for this library, google-cloud-retail, to see the convenience methods for +constructing client objects. Reference documentation for the client objects +themselves can be found in the client library documentation for the versioned +client gems: +[google-cloud-retail-v2](https://cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest). + +See also the [Product Documentation](https://cloud.google.com/retail/docs/apis) +for more usage information. + +## Quick Start + +``` +$ gem install google-cloud-retail +``` + +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) + +```ruby +require "google/cloud/retail" + +client = Google::Cloud::Retail.analytics_service +request = ::Google::Cloud::Retail::V2::ExportAnalyticsMetricsRequest.new # (request fields as keyword arguments...) +response = client.export_analytics_metrics request +``` + +## 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. + +Debug logging also requires that the versioned clients for this service be +sufficiently recent, released after about Dec 10, 2024. If logging is not +working, try updating the versioned clients in your bundle or installed gems: +[google-cloud-retail-v2](https://cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest). + +## 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/Rakefile b/owl-bot-staging/google-cloud-retail/Rakefile new file mode 100644 index 000000000000..b6f97c47d721 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail/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 = true +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 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 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 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 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 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-retail" + header "google-cloud-retail rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-retail yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-retail 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 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 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/google-cloud-retail.gemspec b/owl-bot-staging/google-cloud-retail/google-cloud-retail.gemspec new file mode 100644 index 000000000000..0e01c30630ad --- /dev/null +++ b/owl-bot-staging/google-cloud-retail/google-cloud-retail.gemspec @@ -0,0 +1,27 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/retail/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-retail" + gem.version = Google::Cloud::Retail::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." + gem.summary = "API Client library for the Retail 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") + + ["README.md", "AUTHENTICATION.md", "LICENSE.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 3.0" + + gem.add_dependency "google-cloud-core", "~> 1.6" + gem.add_dependency "google-cloud-retail-v2", "~> 2.0" +end diff --git a/owl-bot-staging/google-cloud-retail/lib/google-cloud-retail.rb b/owl-bot-staging/google-cloud-retail/lib/google-cloud-retail.rb new file mode 100644 index 000000000000..5d5f31cfdc1d --- /dev/null +++ b/owl-bot-staging/google-cloud-retail/lib/google-cloud-retail.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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" unless defined? Google::Cloud::Retail::VERSION diff --git a/owl-bot-staging/google-cloud-retail/lib/google/cloud/retail.rb b/owl-bot-staging/google-cloud-retail/lib/google/cloud/retail.rb new file mode 100644 index 000000000000..a844c1427f76 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail/lib/google/cloud/retail.rb @@ -0,0 +1,949 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# Require this file early so that the version constant gets defined before +# requiring "google/cloud". This is because google-cloud-core will load the +# entrypoint (gem name) file, which in turn re-requires this file (hence +# causing a require cycle) unless the version constant is already defined. +require "google/cloud/retail/version" + +require "googleauth" +gem "google-cloud-core" +require "google/cloud" unless defined? ::Google::Cloud.new +require "google/cloud/config" + +# Set the default configuration +::Google::Cloud.configure.add_config! :retail do |config| + config.add_field! :endpoint, nil, match: ::String + config.add_field! :credentials, nil, match: [::String, ::Hash, ::Google::Auth::Credentials] + config.add_field! :scope, nil, match: [::Array, ::String] + config.add_field! :lib_name, nil, match: ::String + config.add_field! :lib_version, nil, match: ::String + config.add_field! :interceptors, nil, match: ::Array + config.add_field! :timeout, nil, match: ::Numeric + config.add_field! :metadata, nil, match: ::Hash + config.add_field! :retry_policy, nil, match: [::Hash, ::Proc] + config.add_field! :quota_project, nil, match: ::String + config.add_field! :universe_domain, nil, match: ::String +end + +module Google + module Cloud + module Retail + ## + # Create a new client object for AnalyticsService. + # + # By default, this returns an instance of + # [Google::Cloud::Retail::V2::AnalyticsService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-AnalyticsService-Client) + # for a gRPC client for version V2 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the AnalyticsService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the AnalyticsService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Retail.analytics_service_available?}. + # + # ## About AnalyticsService + # + # Service for managing & accessing retail search business metric. + # Retail recommendation business metric is currently not available. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v2`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.analytics_service version: :v2, transport: :grpc, &block + require "google/cloud/retail/#{version.to_s.downcase}" + + package_name = Google::Cloud::Retail + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Retail.const_get(package_name).const_get(:AnalyticsService) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the AnalyticsService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Retail.analytics_service}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the AnalyticsService service, + # or if the versioned client gem needs an update to support the AnalyticsService service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v2`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.analytics_service_available? version: :v2, transport: :grpc + require "google/cloud/retail/#{version.to_s.downcase}" + package_name = Google::Cloud::Retail + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Retail.const_get package_name + return false unless service_module.const_defined? :AnalyticsService + service_module = service_module.const_get :AnalyticsService + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for CatalogService. + # + # By default, this returns an instance of + # [Google::Cloud::Retail::V2::CatalogService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-CatalogService-Client) + # for a gRPC client for version V2 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the CatalogService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the CatalogService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Retail.catalog_service_available?}. + # + # ## About CatalogService + # + # Service for managing catalog configuration. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v2`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.catalog_service version: :v2, transport: :grpc, &block + require "google/cloud/retail/#{version.to_s.downcase}" + + package_name = Google::Cloud::Retail + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Retail.const_get(package_name).const_get(:CatalogService) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the CatalogService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Retail.catalog_service}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the CatalogService service, + # or if the versioned client gem needs an update to support the CatalogService service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v2`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.catalog_service_available? version: :v2, transport: :grpc + require "google/cloud/retail/#{version.to_s.downcase}" + package_name = Google::Cloud::Retail + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Retail.const_get package_name + return false unless service_module.const_defined? :CatalogService + service_module = service_module.const_get :CatalogService + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for CompletionService. + # + # By default, this returns an instance of + # [Google::Cloud::Retail::V2::CompletionService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-CompletionService-Client) + # for a gRPC client for version V2 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the CompletionService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the CompletionService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Retail.completion_service_available?}. + # + # ## About 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. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v2`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.completion_service version: :v2, transport: :grpc, &block + require "google/cloud/retail/#{version.to_s.downcase}" + + package_name = Google::Cloud::Retail + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Retail.const_get(package_name).const_get(:CompletionService) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the CompletionService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Retail.completion_service}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the CompletionService service, + # or if the versioned client gem needs an update to support the CompletionService service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v2`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.completion_service_available? version: :v2, transport: :grpc + require "google/cloud/retail/#{version.to_s.downcase}" + package_name = Google::Cloud::Retail + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Retail.const_get package_name + return false unless service_module.const_defined? :CompletionService + service_module = service_module.const_get :CompletionService + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for ControlService. + # + # By default, this returns an instance of + # [Google::Cloud::Retail::V2::ControlService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ControlService-Client) + # for a gRPC client for version V2 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the ControlService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the ControlService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Retail.control_service_available?}. + # + # ## About ControlService + # + # Service for modifying Control. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v2`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.control_service version: :v2, transport: :grpc, &block + require "google/cloud/retail/#{version.to_s.downcase}" + + package_name = Google::Cloud::Retail + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Retail.const_get(package_name).const_get(:ControlService) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the ControlService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Retail.control_service}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the ControlService service, + # or if the versioned client gem needs an update to support the ControlService service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v2`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.control_service_available? version: :v2, transport: :grpc + require "google/cloud/retail/#{version.to_s.downcase}" + package_name = Google::Cloud::Retail + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Retail.const_get package_name + return false unless service_module.const_defined? :ControlService + service_module = service_module.const_get :ControlService + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for SearchService. + # + # By default, this returns an instance of + # [Google::Cloud::Retail::V2::SearchService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-SearchService-Client) + # for a gRPC client for version V2 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the SearchService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the SearchService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Retail.search_service_available?}. + # + # ## About 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. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v2`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.search_service version: :v2, transport: :grpc, &block + require "google/cloud/retail/#{version.to_s.downcase}" + + package_name = Google::Cloud::Retail + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Retail.const_get(package_name).const_get(:SearchService) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the SearchService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Retail.search_service}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the SearchService service, + # or if the versioned client gem needs an update to support the SearchService service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v2`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.search_service_available? version: :v2, transport: :grpc + require "google/cloud/retail/#{version.to_s.downcase}" + package_name = Google::Cloud::Retail + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Retail.const_get package_name + return false unless service_module.const_defined? :SearchService + service_module = service_module.const_get :SearchService + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for ConversationalSearchService. + # + # By default, this returns an instance of + # [Google::Cloud::Retail::V2::ConversationalSearchService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ConversationalSearchService-Client) + # for a gRPC client for version V2 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the ConversationalSearchService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the ConversationalSearchService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Retail.conversational_search_service_available?}. + # + # ## About 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. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v2`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.conversational_search_service version: :v2, transport: :grpc, &block + require "google/cloud/retail/#{version.to_s.downcase}" + + package_name = Google::Cloud::Retail + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Retail.const_get(package_name).const_get(:ConversationalSearchService) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the ConversationalSearchService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Retail.conversational_search_service}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the ConversationalSearchService service, + # or if the versioned client gem needs an update to support the ConversationalSearchService service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v2`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.conversational_search_service_available? version: :v2, transport: :grpc + require "google/cloud/retail/#{version.to_s.downcase}" + package_name = Google::Cloud::Retail + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Retail.const_get package_name + return false unless service_module.const_defined? :ConversationalSearchService + service_module = service_module.const_get :ConversationalSearchService + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for GenerativeQuestionService. + # + # By default, this returns an instance of + # [Google::Cloud::Retail::V2::GenerativeQuestionService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-GenerativeQuestionService-Client) + # for a gRPC client for version V2 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the GenerativeQuestionService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the GenerativeQuestionService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Retail.generative_question_service_available?}. + # + # ## About GenerativeQuestionService + # + # Service for managing LLM generated questions in search serving. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v2`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.generative_question_service version: :v2, transport: :grpc, &block + require "google/cloud/retail/#{version.to_s.downcase}" + + package_name = Google::Cloud::Retail + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Retail.const_get(package_name).const_get(:GenerativeQuestionService) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the GenerativeQuestionService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Retail.generative_question_service}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the GenerativeQuestionService service, + # or if the versioned client gem needs an update to support the GenerativeQuestionService service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v2`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.generative_question_service_available? version: :v2, transport: :grpc + require "google/cloud/retail/#{version.to_s.downcase}" + package_name = Google::Cloud::Retail + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Retail.const_get package_name + return false unless service_module.const_defined? :GenerativeQuestionService + service_module = service_module.const_get :GenerativeQuestionService + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for ModelService. + # + # By default, this returns an instance of + # [Google::Cloud::Retail::V2::ModelService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ModelService-Client) + # for a gRPC client for version V2 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the ModelService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the ModelService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Retail.model_service_available?}. + # + # ## About ModelService + # + # 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. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v2`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.model_service version: :v2, transport: :grpc, &block + require "google/cloud/retail/#{version.to_s.downcase}" + + package_name = Google::Cloud::Retail + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Retail.const_get(package_name).const_get(:ModelService) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the ModelService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Retail.model_service}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the ModelService service, + # or if the versioned client gem needs an update to support the ModelService service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v2`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.model_service_available? version: :v2, transport: :grpc + require "google/cloud/retail/#{version.to_s.downcase}" + package_name = Google::Cloud::Retail + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Retail.const_get package_name + return false unless service_module.const_defined? :ModelService + service_module = service_module.const_get :ModelService + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for PredictionService. + # + # By default, this returns an instance of + # [Google::Cloud::Retail::V2::PredictionService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-PredictionService-Client) + # for a gRPC client for version V2 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the PredictionService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the PredictionService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Retail.prediction_service_available?}. + # + # ## About PredictionService + # + # Service for making recommendation prediction. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v2`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.prediction_service version: :v2, transport: :grpc, &block + require "google/cloud/retail/#{version.to_s.downcase}" + + package_name = Google::Cloud::Retail + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Retail.const_get(package_name).const_get(:PredictionService) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the PredictionService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Retail.prediction_service}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the PredictionService service, + # or if the versioned client gem needs an update to support the PredictionService service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v2`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.prediction_service_available? version: :v2, transport: :grpc + require "google/cloud/retail/#{version.to_s.downcase}" + package_name = Google::Cloud::Retail + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Retail.const_get package_name + return false unless service_module.const_defined? :PredictionService + service_module = service_module.const_get :PredictionService + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for ProductService. + # + # By default, this returns an instance of + # [Google::Cloud::Retail::V2::ProductService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ProductService-Client) + # for a gRPC client for version V2 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the ProductService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the ProductService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Retail.product_service_available?}. + # + # ## About ProductService + # + # Service for ingesting Product information + # of the customer's website. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v2`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.product_service version: :v2, transport: :grpc, &block + require "google/cloud/retail/#{version.to_s.downcase}" + + package_name = Google::Cloud::Retail + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Retail.const_get(package_name).const_get(:ProductService) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the ProductService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Retail.product_service}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the ProductService service, + # or if the versioned client gem needs an update to support the ProductService service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v2`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.product_service_available? version: :v2, transport: :grpc + require "google/cloud/retail/#{version.to_s.downcase}" + package_name = Google::Cloud::Retail + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Retail.const_get package_name + return false unless service_module.const_defined? :ProductService + service_module = service_module.const_get :ProductService + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for ServingConfigService. + # + # By default, this returns an instance of + # [Google::Cloud::Retail::V2::ServingConfigService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ServingConfigService-Client) + # for a gRPC client for version V2 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the ServingConfigService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the ServingConfigService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Retail.serving_config_service_available?}. + # + # ## About ServingConfigService + # + # Service for modifying ServingConfig. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v2`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.serving_config_service version: :v2, transport: :grpc, &block + require "google/cloud/retail/#{version.to_s.downcase}" + + package_name = Google::Cloud::Retail + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Retail.const_get(package_name).const_get(:ServingConfigService) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the ServingConfigService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Retail.serving_config_service}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the ServingConfigService service, + # or if the versioned client gem needs an update to support the ServingConfigService service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v2`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.serving_config_service_available? version: :v2, transport: :grpc + require "google/cloud/retail/#{version.to_s.downcase}" + package_name = Google::Cloud::Retail + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Retail.const_get package_name + return false unless service_module.const_defined? :ServingConfigService + service_module = service_module.const_get :ServingConfigService + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for UserEventService. + # + # By default, this returns an instance of + # [Google::Cloud::Retail::V2::UserEventService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-UserEventService-Client) + # for a gRPC client for version V2 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the UserEventService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the UserEventService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Retail.user_event_service_available?}. + # + # ## About UserEventService + # + # Service for ingesting end user actions on the customer website. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v2`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.user_event_service version: :v2, transport: :grpc, &block + require "google/cloud/retail/#{version.to_s.downcase}" + + package_name = Google::Cloud::Retail + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Retail.const_get(package_name).const_get(:UserEventService) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the UserEventService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Retail.user_event_service}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the UserEventService service, + # or if the versioned client gem needs an update to support the UserEventService service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v2`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.user_event_service_available? version: :v2, transport: :grpc + require "google/cloud/retail/#{version.to_s.downcase}" + package_name = Google::Cloud::Retail + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Retail.const_get package_name + return false unless service_module.const_defined? :UserEventService + service_module = service_module.const_get :UserEventService + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Configure the google-cloud-retail library. + # + # The following configuration parameters are supported: + # + # * `credentials` (*type:* `String, Hash, Google::Auth::Credentials`) - + # The path to the keyfile as a String, the contents of the keyfile as a + # Hash, or a Google::Auth::Credentials object. + # * `lib_name` (*type:* `String`) - + # The library name as recorded in instrumentation and logging. + # * `lib_version` (*type:* `String`) - + # The library version as recorded in instrumentation and logging. + # * `interceptors` (*type:* `Array`) - + # An array of interceptors that are run before calls are executed. + # * `timeout` (*type:* `Numeric`) - + # Default timeout in seconds. + # * `metadata` (*type:* `Hash{Symbol=>String}`) - + # Additional headers to be sent with the call. + # * `retry_policy` (*type:* `Hash`) - + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - + # The error codes that should trigger a retry. + # + # @return [::Google::Cloud::Config] The default configuration used by this library + # + def self.configure + yield ::Google::Cloud.configure.retail if block_given? + + ::Google::Cloud.configure.retail + end + end + end +end + +helper_path = ::File.join __dir__, "retail", "helpers.rb" +require "google/cloud/retail/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-retail/lib/google/cloud/retail/version.rb b/owl-bot-staging/google-cloud-retail/lib/google/cloud/retail/version.rb new file mode 100644 index 000000000000..e74c93ac7413 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail/lib/google/cloud/retail/version.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! + + +module Google + module Cloud + module Retail + VERSION = "0.0.1" + end + end +end diff --git a/owl-bot-staging/google-cloud-retail/test/google/cloud/retail/client_test.rb b/owl-bot-staging/google-cloud-retail/test/google/cloud/retail/client_test.rb new file mode 100644 index 000000000000..66c341b97da2 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail/test/google/cloud/retail/client_test.rb @@ -0,0 +1,295 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "google/cloud/retail" +require "gapic/common" +require "gapic/grpc" +require "gapic/rest" + +class Google::Cloud::Retail::ClientConstructionMinitest < 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_analytics_service_grpc + skip unless Google::Cloud::Retail.analytics_service_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::Retail.analytics_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::Retail::V2::AnalyticsService::Client, client + end + end + + def test_analytics_service_rest + skip unless Google::Cloud::Retail.analytics_service_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Retail.analytics_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Retail::V2::AnalyticsService::Rest::Client, client + end + end + + def test_catalog_service_grpc + skip unless Google::Cloud::Retail.catalog_service_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::Retail.catalog_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::Retail::V2::CatalogService::Client, client + end + end + + def test_catalog_service_rest + skip unless Google::Cloud::Retail.catalog_service_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Retail.catalog_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Retail::V2::CatalogService::Rest::Client, client + end + end + + def test_completion_service_grpc + skip unless Google::Cloud::Retail.completion_service_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::Retail.completion_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::Retail::V2::CompletionService::Client, client + end + end + + def test_completion_service_rest + skip unless Google::Cloud::Retail.completion_service_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Retail.completion_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Retail::V2::CompletionService::Rest::Client, client + end + end + + def test_control_service_grpc + skip unless Google::Cloud::Retail.control_service_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::Retail.control_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::Retail::V2::ControlService::Client, client + end + end + + def test_control_service_rest + skip unless Google::Cloud::Retail.control_service_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Retail.control_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Retail::V2::ControlService::Rest::Client, client + end + end + + def test_search_service_grpc + skip unless Google::Cloud::Retail.search_service_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::Retail.search_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::Retail::V2::SearchService::Client, client + end + end + + def test_search_service_rest + skip unless Google::Cloud::Retail.search_service_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Retail.search_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Retail::V2::SearchService::Rest::Client, client + end + end + + def test_conversational_search_service_grpc + skip unless Google::Cloud::Retail.conversational_search_service_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::Retail.conversational_search_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::Retail::V2::ConversationalSearchService::Client, client + end + end + + def test_conversational_search_service_rest + skip unless Google::Cloud::Retail.conversational_search_service_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Retail.conversational_search_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Retail::V2::ConversationalSearchService::Rest::Client, client + end + end + + def test_generative_question_service_grpc + skip unless Google::Cloud::Retail.generative_question_service_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::Retail.generative_question_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::Retail::V2::GenerativeQuestionService::Client, client + end + end + + def test_generative_question_service_rest + skip unless Google::Cloud::Retail.generative_question_service_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Retail.generative_question_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Retail::V2::GenerativeQuestionService::Rest::Client, client + end + end + + def test_model_service_grpc + skip unless Google::Cloud::Retail.model_service_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::Retail.model_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::Retail::V2::ModelService::Client, client + end + end + + def test_model_service_rest + skip unless Google::Cloud::Retail.model_service_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Retail.model_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Retail::V2::ModelService::Rest::Client, client + end + end + + def test_prediction_service_grpc + skip unless Google::Cloud::Retail.prediction_service_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::Retail.prediction_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::Retail::V2::PredictionService::Client, client + end + end + + def test_prediction_service_rest + skip unless Google::Cloud::Retail.prediction_service_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Retail.prediction_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Retail::V2::PredictionService::Rest::Client, client + end + end + + def test_product_service_grpc + skip unless Google::Cloud::Retail.product_service_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::Retail.product_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::Retail::V2::ProductService::Client, client + end + end + + def test_product_service_rest + skip unless Google::Cloud::Retail.product_service_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Retail.product_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Retail::V2::ProductService::Rest::Client, client + end + end + + def test_serving_config_service_grpc + skip unless Google::Cloud::Retail.serving_config_service_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::Retail.serving_config_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::Retail::V2::ServingConfigService::Client, client + end + end + + def test_serving_config_service_rest + skip unless Google::Cloud::Retail.serving_config_service_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Retail.serving_config_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Retail::V2::ServingConfigService::Rest::Client, client + end + end + + def test_user_event_service_grpc + skip unless Google::Cloud::Retail.user_event_service_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::Retail.user_event_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::Retail::V2::UserEventService::Client, client + end + end + + def test_user_event_service_rest + skip unless Google::Cloud::Retail.user_event_service_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Retail.user_event_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Retail::V2::UserEventService::Rest::Client, client + end + end +end diff --git a/owl-bot-staging/google-cloud-retail/test/google/cloud/retail/version_test.rb b/owl-bot-staging/google-cloud-retail/test/google/cloud/retail/version_test.rb new file mode 100644 index 000000000000..d6b0727bd7a8 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail/test/google/cloud/retail/version_test.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 "helper" +require "google/cloud/retail/version" + +class Google::Cloud::Retail::VersionMinitest < Minitest::Test + def test_has_a_version + refute_nil Google::Cloud::Retail::VERSION + end +end diff --git a/owl-bot-staging/google-cloud-retail/test/helper.rb b/owl-bot-staging/google-cloud-retail/test/helper.rb new file mode 100644 index 000000000000..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-retail/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" + +require "ostruct" diff --git a/owl-bot-staging/google-cloud-run-client/.gitignore b/owl-bot-staging/google-cloud-run-client/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-run-client/.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-run-client/.repo-metadata.json b/owl-bot-staging/google-cloud-run-client/.repo-metadata.json new file mode 100644 index 000000000000..4ae6c80548ae --- /dev/null +++ b/owl-bot-staging/google-cloud-run-client/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "api_id": "run.googleapis.com", + "api_shortname": "run", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-run/latest", + "distribution_name": "google-cloud-run", + "is_cloud": true, + "language": "ruby", + "name": "run", + "name_pretty": "Cloud Run API", + "product_documentation": "https://cloud.google.com/run", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Cloud Run deploys and manages user provided container images that scale automatically based on incoming requests.", + "ruby-cloud-product-url": "https://cloud.google.com/run", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-run-client/.rubocop.yml b/owl-bot-staging/google-cloud-run-client/.rubocop.yml new file mode 100644 index 000000000000..ad7933d2c5c6 --- /dev/null +++ b/owl-bot-staging/google-cloud-run-client/.rubocop.yml @@ -0,0 +1,39 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-run.gemspec" + - "Rakefile" + - "acceptance/**/*" + - "test/**/*" + +Bundler/OrderedGems: + Enabled: false +Documentation: + Enabled: false +Layout/LineLength: + Enabled: false +Metrics/BlockLength: + Exclude: + - "samples/**/acceptance/*.rb" +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/FileName: + Exclude: + - "lib/google-cloud-run.rb" + +Style/BlockDelimiters: + Exclude: + - "samples/**/acceptance/*.rb" diff --git a/owl-bot-staging/google-cloud-run-client/.toys.rb b/owl-bot-staging/google-cloud-run-client/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-run-client/.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-run-client/.yardopts b/owl-bot-staging/google-cloud-run-client/.yardopts new file mode 100644 index 000000000000..a35195cf2f13 --- /dev/null +++ b/owl-bot-staging/google-cloud-run-client/.yardopts @@ -0,0 +1,11 @@ +--no-private +--title="Cloud Run API" +--exclude _pb\.rb$ +--markup markdown +--markup-provider redcarpet + +./lib/**/*.rb +- +README.md +AUTHENTICATION.md +LICENSE.md diff --git a/owl-bot-staging/google-cloud-run-client/AUTHENTICATION.md b/owl-bot-staging/google-cloud-run-client/AUTHENTICATION.md new file mode 100644 index 000000000000..cb9bbe37a075 --- /dev/null +++ b/owl-bot-staging/google-cloud-run-client/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-run 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-run 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/run" + +client = Google::Cloud::Run.builds do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/run" + +Google::Cloud::Run.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = Google::Cloud::Run.builds +``` + +### 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-run +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/run" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = Google::Cloud::Run.builds +``` + +### 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-run-client/CHANGELOG.md b/owl-bot-staging/google-cloud-run-client/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-run-client/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-run-client/Gemfile b/owl-bot-staging/google-cloud-run-client/Gemfile new file mode 100644 index 000000000000..072162d17bd4 --- /dev/null +++ b/owl-bot-staging/google-cloud-run-client/Gemfile @@ -0,0 +1,28 @@ +source "https://rubygems.org" + +gemspec + +local_dependencies = ["google-cloud-run-v2"] + +main_spec = gemspecs.last || Bundler.load_gemspec(File.join(__dir__, "google-cloud-run.gemspec")) +local_dependencies.each do |name| + spec_path = File.expand_path "../#{name}/#{name}.gemspec", __dir__ + unless File.file? spec_path + warn "WARNING: Disabled local dependency for #{name} because gemspec not found." + next + end + version = Bundler.load_gemspec(spec_path).version + if main_spec.dependencies.any? { |dep| dep.name == name && !dep.requirement.satisfied_by?(version) } + warn "WARNING: Disabled local dependency for #{name} because the gemspec disallows version #{version}." + next + end + gem name, path: "../#{name}" +end + +gem "google-style", "~> 1.30.1" +gem "minitest", "~> 5.22" +gem "minitest-focus", "~> 1.4" +gem "minitest-rg", "~> 5.3" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-run-client/LICENSE.md b/owl-bot-staging/google-cloud-run-client/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-run-client/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-run-client/README.md b/owl-bot-staging/google-cloud-run-client/README.md new file mode 100644 index 000000000000..f34a98840d4f --- /dev/null +++ b/owl-bot-staging/google-cloud-run-client/README.md @@ -0,0 +1,142 @@ +# Ruby Client for the Cloud Run API + +API Client library for the Cloud Run API + +Cloud Run deploys and manages user provided container images that scale automatically based on incoming requests. + +Actual client classes for the various versions of this API are defined in +_versioned_ client gems, with names of the form `google-cloud-run-v*`. +The gem `google-cloud-run` is the main client library that brings the +versioned gems in as dependencies, and provides high-level methods for +constructing clients. More information on versioned clients can be found below +in the section titled *Which client should I use?*. + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-run/latest) +for this library, google-cloud-run, to see the convenience methods for +constructing client objects. Reference documentation for the client objects +themselves can be found in the client library documentation for the versioned +client gems: +[google-cloud-run-v2](https://cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest). + +See also the [Product Documentation](https://cloud.google.com/run) +for more usage information. + +## Quick Start + +``` +$ gem install google-cloud-run +``` + +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/run.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +```ruby +require "google/cloud/run" + +client = Google::Cloud::Run.builds +request = ::Google::Cloud::Run::V2::SubmitBuildRequest.new # (request fields as keyword arguments...) +response = client.submit_build request +``` + +## 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. + +Debug logging also requires that the versioned clients for this service be +sufficiently recent, released after about Dec 10, 2024. If logging is not +working, try updating the versioned clients in your bundle or installed gems: +[google-cloud-run-v2](https://cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest). + +## 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-run`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-run-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-run`. +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-run-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-run-client/Rakefile b/owl-bot-staging/google-cloud-run-client/Rakefile new file mode 100644 index 000000000000..7e92d30093b8 --- /dev/null +++ b/owl-bot-staging/google-cloud-run-client/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 = true +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-run 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/run/v2/builds/credentials" + ::Google::Cloud::Run::V2::Builds::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-run 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-run 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-run 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-run gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-run" + header "google-cloud-run rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-run yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-run 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-run 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-run 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-run-client/google-cloud-run.gemspec b/owl-bot-staging/google-cloud-run-client/google-cloud-run.gemspec new file mode 100644 index 000000000000..cf668f5eda5a --- /dev/null +++ b/owl-bot-staging/google-cloud-run-client/google-cloud-run.gemspec @@ -0,0 +1,27 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/run/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-run" + gem.version = Google::Cloud::Run::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Cloud Run deploys and manages user provided container images that scale automatically based on incoming requests." + gem.summary = "API Client library for the Cloud Run 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") + + ["README.md", "AUTHENTICATION.md", "LICENSE.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 3.0" + + gem.add_dependency "google-cloud-core", "~> 1.6" + gem.add_dependency "google-cloud-run-v2", ">= 0.17", "< 2.a" +end diff --git a/owl-bot-staging/google-cloud-run-client/lib/google-cloud-run.rb b/owl-bot-staging/google-cloud-run-client/lib/google-cloud-run.rb new file mode 100644 index 000000000000..5decb206ead1 --- /dev/null +++ b/owl-bot-staging/google-cloud-run-client/lib/google-cloud-run.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/run" unless defined? Google::Cloud::Run::VERSION diff --git a/owl-bot-staging/google-cloud-run-client/lib/google/cloud/run.rb b/owl-bot-staging/google-cloud-run-client/lib/google/cloud/run.rb new file mode 100644 index 000000000000..6a3aebbef5c9 --- /dev/null +++ b/owl-bot-staging/google-cloud-run-client/lib/google/cloud/run.rb @@ -0,0 +1,576 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# Require this file early so that the version constant gets defined before +# requiring "google/cloud". This is because google-cloud-core will load the +# entrypoint (gem name) file, which in turn re-requires this file (hence +# causing a require cycle) unless the version constant is already defined. +require "google/cloud/run/version" + +require "googleauth" +gem "google-cloud-core" +require "google/cloud" unless defined? ::Google::Cloud.new +require "google/cloud/config" + +# Set the default configuration +::Google::Cloud.configure.add_config! :run do |config| + config.add_field! :endpoint, nil, match: ::String + config.add_field! :credentials, nil, match: [::String, ::Hash, ::Google::Auth::Credentials] + config.add_field! :scope, nil, match: [::Array, ::String] + config.add_field! :lib_name, nil, match: ::String + config.add_field! :lib_version, nil, match: ::String + config.add_field! :interceptors, nil, match: ::Array + config.add_field! :timeout, nil, match: ::Numeric + config.add_field! :metadata, nil, match: ::Hash + config.add_field! :retry_policy, nil, match: [::Hash, ::Proc] + config.add_field! :quota_project, nil, match: ::String + config.add_field! :universe_domain, nil, match: ::String +end + +module Google + module Cloud + module Run + ## + # Create a new client object for Builds. + # + # By default, this returns an instance of + # [Google::Cloud::Run::V2::Builds::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest/Google-Cloud-Run-V2-Builds-Client) + # for a gRPC client for version V2 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the Builds service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the Builds service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Run.builds_available?}. + # + # ## About Builds + # + # Cloud Run Build Control Plane API + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v2`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.builds version: :v2, transport: :grpc, &block + require "google/cloud/run/#{version.to_s.downcase}" + + package_name = Google::Cloud::Run + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Run.const_get(package_name).const_get(:Builds) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the Builds service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Run.builds}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the Builds service, + # or if the versioned client gem needs an update to support the Builds service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v2`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.builds_available? version: :v2, transport: :grpc + require "google/cloud/run/#{version.to_s.downcase}" + package_name = Google::Cloud::Run + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Run.const_get package_name + return false unless service_module.const_defined? :Builds + service_module = service_module.const_get :Builds + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for Executions. + # + # By default, this returns an instance of + # [Google::Cloud::Run::V2::Executions::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest/Google-Cloud-Run-V2-Executions-Client) + # for a gRPC client for version V2 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the Executions service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the Executions service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Run.executions_available?}. + # + # ## About Executions + # + # Cloud Run Execution Control Plane API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v2`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.executions version: :v2, transport: :grpc, &block + require "google/cloud/run/#{version.to_s.downcase}" + + package_name = Google::Cloud::Run + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Run.const_get(package_name).const_get(:Executions) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the Executions service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Run.executions}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the Executions service, + # or if the versioned client gem needs an update to support the Executions service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v2`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.executions_available? version: :v2, transport: :grpc + require "google/cloud/run/#{version.to_s.downcase}" + package_name = Google::Cloud::Run + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Run.const_get package_name + return false unless service_module.const_defined? :Executions + service_module = service_module.const_get :Executions + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for Jobs. + # + # By default, this returns an instance of + # [Google::Cloud::Run::V2::Jobs::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest/Google-Cloud-Run-V2-Jobs-Client) + # for a gRPC client for version V2 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the Jobs service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the Jobs service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Run.jobs_available?}. + # + # ## About Jobs + # + # Cloud Run Job Control Plane API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v2`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.jobs version: :v2, transport: :grpc, &block + require "google/cloud/run/#{version.to_s.downcase}" + + package_name = Google::Cloud::Run + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Run.const_get(package_name).const_get(:Jobs) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the Jobs service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Run.jobs}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the Jobs service, + # or if the versioned client gem needs an update to support the Jobs service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v2`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.jobs_available? version: :v2, transport: :grpc + require "google/cloud/run/#{version.to_s.downcase}" + package_name = Google::Cloud::Run + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Run.const_get package_name + return false unless service_module.const_defined? :Jobs + service_module = service_module.const_get :Jobs + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for Revisions. + # + # By default, this returns an instance of + # [Google::Cloud::Run::V2::Revisions::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest/Google-Cloud-Run-V2-Revisions-Client) + # for a gRPC client for version V2 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the Revisions service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the Revisions service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Run.revisions_available?}. + # + # ## About Revisions + # + # Cloud Run Revision Control Plane API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v2`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.revisions version: :v2, transport: :grpc, &block + require "google/cloud/run/#{version.to_s.downcase}" + + package_name = Google::Cloud::Run + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Run.const_get(package_name).const_get(:Revisions) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the Revisions service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Run.revisions}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the Revisions service, + # or if the versioned client gem needs an update to support the Revisions service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v2`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.revisions_available? version: :v2, transport: :grpc + require "google/cloud/run/#{version.to_s.downcase}" + package_name = Google::Cloud::Run + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Run.const_get package_name + return false unless service_module.const_defined? :Revisions + service_module = service_module.const_get :Revisions + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for Services. + # + # By default, this returns an instance of + # [Google::Cloud::Run::V2::Services::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest/Google-Cloud-Run-V2-Services-Client) + # for a gRPC client for version V2 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the Services service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the Services service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Run.services_available?}. + # + # ## About Services + # + # Cloud Run Service Control Plane API + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v2`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.services version: :v2, transport: :grpc, &block + require "google/cloud/run/#{version.to_s.downcase}" + + package_name = Google::Cloud::Run + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Run.const_get(package_name).const_get(:Services) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the Services service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Run.services}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the Services service, + # or if the versioned client gem needs an update to support the Services service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v2`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.services_available? version: :v2, transport: :grpc + require "google/cloud/run/#{version.to_s.downcase}" + package_name = Google::Cloud::Run + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Run.const_get package_name + return false unless service_module.const_defined? :Services + service_module = service_module.const_get :Services + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for Tasks. + # + # By default, this returns an instance of + # [Google::Cloud::Run::V2::Tasks::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest/Google-Cloud-Run-V2-Tasks-Client) + # for a gRPC client for version V2 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the Tasks service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the Tasks service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Run.tasks_available?}. + # + # ## About Tasks + # + # Cloud Run Task Control Plane API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v2`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.tasks version: :v2, transport: :grpc, &block + require "google/cloud/run/#{version.to_s.downcase}" + + package_name = Google::Cloud::Run + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Run.const_get(package_name).const_get(:Tasks) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the Tasks service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Run.tasks}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the Tasks service, + # or if the versioned client gem needs an update to support the Tasks service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v2`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.tasks_available? version: :v2, transport: :grpc + require "google/cloud/run/#{version.to_s.downcase}" + package_name = Google::Cloud::Run + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Run.const_get package_name + return false unless service_module.const_defined? :Tasks + service_module = service_module.const_get :Tasks + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for WorkerPools. + # + # By default, this returns an instance of + # [Google::Cloud::Run::V2::WorkerPools::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest/Google-Cloud-Run-V2-WorkerPools-Client) + # for a gRPC client for version V2 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the WorkerPools service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the WorkerPools service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Run.worker_pools_available?}. + # + # ## About WorkerPools + # + # Cloud Run WorkerPool Control Plane API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v2`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.worker_pools version: :v2, transport: :grpc, &block + require "google/cloud/run/#{version.to_s.downcase}" + + package_name = Google::Cloud::Run + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Run.const_get(package_name).const_get(:WorkerPools) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the WorkerPools service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Run.worker_pools}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the WorkerPools service, + # or if the versioned client gem needs an update to support the WorkerPools service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v2`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.worker_pools_available? version: :v2, transport: :grpc + require "google/cloud/run/#{version.to_s.downcase}" + package_name = Google::Cloud::Run + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Run.const_get package_name + return false unless service_module.const_defined? :WorkerPools + service_module = service_module.const_get :WorkerPools + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Configure the google-cloud-run library. + # + # The following configuration parameters are supported: + # + # * `credentials` (*type:* `String, Hash, Google::Auth::Credentials`) - + # The path to the keyfile as a String, the contents of the keyfile as a + # Hash, or a Google::Auth::Credentials object. + # * `lib_name` (*type:* `String`) - + # The library name as recorded in instrumentation and logging. + # * `lib_version` (*type:* `String`) - + # The library version as recorded in instrumentation and logging. + # * `interceptors` (*type:* `Array`) - + # An array of interceptors that are run before calls are executed. + # * `timeout` (*type:* `Numeric`) - + # Default timeout in seconds. + # * `metadata` (*type:* `Hash{Symbol=>String}`) - + # Additional headers to be sent with the call. + # * `retry_policy` (*type:* `Hash`) - + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - + # The error codes that should trigger a retry. + # + # @return [::Google::Cloud::Config] The default configuration used by this library + # + def self.configure + yield ::Google::Cloud.configure.run if block_given? + + ::Google::Cloud.configure.run + end + end + end +end + +helper_path = ::File.join __dir__, "run", "helpers.rb" +require "google/cloud/run/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-run-client/lib/google/cloud/run/version.rb b/owl-bot-staging/google-cloud-run-client/lib/google/cloud/run/version.rb new file mode 100644 index 000000000000..09106e21d937 --- /dev/null +++ b/owl-bot-staging/google-cloud-run-client/lib/google/cloud/run/version.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! + + +module Google + module Cloud + module Run + VERSION = "0.0.1" + end + end +end diff --git a/owl-bot-staging/google-cloud-run-client/test/google/cloud/run/client_test.rb b/owl-bot-staging/google-cloud-run-client/test/google/cloud/run/client_test.rb new file mode 100644 index 000000000000..b6227307083d --- /dev/null +++ b/owl-bot-staging/google-cloud-run-client/test/google/cloud/run/client_test.rb @@ -0,0 +1,190 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "google/cloud/run" +require "gapic/common" +require "gapic/grpc" +require "gapic/rest" + +class Google::Cloud::Run::ClientConstructionMinitest < 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_builds_grpc + skip unless Google::Cloud::Run.builds_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::Run.builds transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::Run::V2::Builds::Client, client + end + end + + def test_builds_rest + skip unless Google::Cloud::Run.builds_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Run.builds transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Run::V2::Builds::Rest::Client, client + end + end + + def test_executions_grpc + skip unless Google::Cloud::Run.executions_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::Run.executions transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::Run::V2::Executions::Client, client + end + end + + def test_executions_rest + skip unless Google::Cloud::Run.executions_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Run.executions transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Run::V2::Executions::Rest::Client, client + end + end + + def test_jobs_grpc + skip unless Google::Cloud::Run.jobs_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::Run.jobs transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::Run::V2::Jobs::Client, client + end + end + + def test_jobs_rest + skip unless Google::Cloud::Run.jobs_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Run.jobs transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Run::V2::Jobs::Rest::Client, client + end + end + + def test_revisions_grpc + skip unless Google::Cloud::Run.revisions_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::Run.revisions transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::Run::V2::Revisions::Client, client + end + end + + def test_revisions_rest + skip unless Google::Cloud::Run.revisions_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Run.revisions transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Run::V2::Revisions::Rest::Client, client + end + end + + def test_services_grpc + skip unless Google::Cloud::Run.services_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::Run.services transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::Run::V2::Services::Client, client + end + end + + def test_services_rest + skip unless Google::Cloud::Run.services_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Run.services transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Run::V2::Services::Rest::Client, client + end + end + + def test_tasks_grpc + skip unless Google::Cloud::Run.tasks_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::Run.tasks transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::Run::V2::Tasks::Client, client + end + end + + def test_tasks_rest + skip unless Google::Cloud::Run.tasks_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Run.tasks transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Run::V2::Tasks::Rest::Client, client + end + end + + def test_worker_pools_grpc + skip unless Google::Cloud::Run.worker_pools_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::Run.worker_pools transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::Run::V2::WorkerPools::Client, client + end + end + + def test_worker_pools_rest + skip unless Google::Cloud::Run.worker_pools_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Run.worker_pools transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Run::V2::WorkerPools::Rest::Client, client + end + end +end diff --git a/owl-bot-staging/google-cloud-run-client/test/google/cloud/run/version_test.rb b/owl-bot-staging/google-cloud-run-client/test/google/cloud/run/version_test.rb new file mode 100644 index 000000000000..95d32d7c9348 --- /dev/null +++ b/owl-bot-staging/google-cloud-run-client/test/google/cloud/run/version_test.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 "helper" +require "google/cloud/run/version" + +class Google::Cloud::Run::VersionMinitest < Minitest::Test + def test_has_a_version + refute_nil Google::Cloud::Run::VERSION + end +end diff --git a/owl-bot-staging/google-cloud-run-client/test/helper.rb b/owl-bot-staging/google-cloud-run-client/test/helper.rb new file mode 100644 index 000000000000..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-run-client/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" + +require "ostruct" 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..6442df18fa2f --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/Gemfile @@ -0,0 +1,11 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.31.1" +gem "minitest", "~> 5.22" +gem "minitest-focus", "~> 1.4" +gem "minitest-rg", "~> 5.3" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-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..47e32029da1c --- /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.1" + + 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..a50b140d0058 --- /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,58 @@ +# 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\"\x91\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\"j\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\"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 + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module 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..1b89f673a7dd --- /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,73 @@ +# 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 + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitVariable", "google/cloud/saasplatform/saasservicemgmt/v1beta1/common.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module 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..5941cded8b40 --- /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,89 @@ +# 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 + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.cloud.saasplatform.saasservicemgmt.v1beta1.Aggregate", "google/cloud/saasplatform/saasservicemgmt/v1beta1/common.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module 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..2ac0ad01734b --- /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,65 @@ +# 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 + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.saasplatform.saasservicemgmt.v1beta1.Rollout", "google/cloud/saasplatform/saasservicemgmt/v1beta1/rollouts_resources.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module 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..d59ba51a5612 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/api/client.rb @@ -0,0 +1,473 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] experimental_features + # @return [::Google::Api::PythonSettings::ExperimentalFeatures] + # Experimental features to be included during client library generation. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Experimental features to be included during client library generation. + # These fields will be deprecated once the feature graduates and is enabled + # by default. + # @!attribute [rw] rest_async_io_enabled + # @return [::Boolean] + # Enables generation of asynchronous REST clients if `rest` transport is + # enabled. By default, asynchronous REST clients will not be generated. + # This feature will be enabled by default 1 month after launching the + # feature in preview packages. + # @!attribute [rw] protobuf_pythonic_types_enabled + # @return [::Boolean] + # Enables generation of protobuf code using new types that are more + # Pythonic which are included in `protobuf>=5.29.x`. This feature will be + # enabled by default 1 month after launching the feature in preview + # packages. + # @!attribute [rw] unversioned_package_disabled + # @return [::Boolean] + # Disables generation of an unversioned Python package for this client + # library. This means that the module names will need to be versioned in + # import statements. For example `import google.cloud.library_v2` instead + # of `import google.cloud.library`. + class ExperimentalFeatures + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map of service names to renamed services. Keys are the package relative + # service names and values are the name to be used for the service client + # and call options. + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # + # Example: + # + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # This message is used to configure the generation of a subset of the RPCs in + # a service for client libraries. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/owl-bot-staging/google-cloud-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..b868eddc20d9 --- /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,231 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for 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 + 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..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" + +require "ostruct" diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/.gitignore b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/.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/.repo-metadata.json b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/.repo-metadata.json new file mode 100644 index 000000000000..ab51463a9016 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/.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/latest", + "distribution_name": "google-cloud-saas_platform-saas_service_mgmt", + "is_cloud": true, + "language": "ruby", + "name": "saasservicemgmt", + "name_pretty": "SaaS Runtime 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.", + "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/.rubocop.yml b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/.rubocop.yml new file mode 100644 index 000000000000..ddc9f5e4cb50 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/.rubocop.yml @@ -0,0 +1,39 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-saas_platform-saas_service_mgmt.gemspec" + - "Rakefile" + - "acceptance/**/*" + - "test/**/*" + +Bundler/OrderedGems: + Enabled: false +Documentation: + Enabled: false +Layout/LineLength: + Enabled: false +Metrics/BlockLength: + Exclude: + - "samples/**/acceptance/*.rb" +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/FileName: + Exclude: + - "lib/google-cloud-saas_platform-saas_service_mgmt.rb" + +Style/BlockDelimiters: + Exclude: + - "samples/**/acceptance/*.rb" diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/.toys.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/.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/.yardopts b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/.yardopts new file mode 100644 index 000000000000..413e7197b7c6 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/.yardopts @@ -0,0 +1,11 @@ +--no-private +--title="SaaS Runtime API" +--exclude _pb\.rb$ +--markup markdown +--markup-provider redcarpet + +./lib/**/*.rb +- +README.md +AUTHENTICATION.md +LICENSE.md diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/AUTHENTICATION.md b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/AUTHENTICATION.md new file mode 100644 index 000000000000..95988c838d8f --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-saas_platform-saas_service_mgmt 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 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" + +client = Google::Cloud::SaasPlatform::SaasServiceMgmt.saas_deployments 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" + +Google::Cloud::SaasPlatform::SaasServiceMgmt.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = Google::Cloud::SaasPlatform::SaasServiceMgmt.saas_deployments +``` + +### 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 +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" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = Google::Cloud::SaasPlatform::SaasServiceMgmt.saas_deployments +``` + +### 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/CHANGELOG.md b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/Gemfile b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/Gemfile new file mode 100644 index 000000000000..a3e9f8e344f3 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/Gemfile @@ -0,0 +1,28 @@ +source "https://rubygems.org" + +gemspec + +local_dependencies = ["google-cloud-saas_platform-saas_service_mgmt-v1beta1"] + +main_spec = gemspecs.last || Bundler.load_gemspec(File.join(__dir__, "google-cloud-saas_platform-saas_service_mgmt.gemspec")) +local_dependencies.each do |name| + spec_path = File.expand_path "../#{name}/#{name}.gemspec", __dir__ + unless File.file? spec_path + warn "WARNING: Disabled local dependency for #{name} because gemspec not found." + next + end + version = Bundler.load_gemspec(spec_path).version + if main_spec.dependencies.any? { |dep| dep.name == name && !dep.requirement.satisfied_by?(version) } + warn "WARNING: Disabled local dependency for #{name} because the gemspec disallows version #{version}." + next + end + gem name, path: "../#{name}" +end + +gem "google-style", "~> 1.30.1" +gem "minitest", "~> 5.22" +gem "minitest-focus", "~> 1.4" +gem "minitest-rg", "~> 5.3" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/LICENSE.md b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/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/README.md b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/README.md new file mode 100644 index 000000000000..5dbf814c0a47 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/README.md @@ -0,0 +1,142 @@ +# Ruby Client for the SaaS Runtime 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. + +Actual client classes for the various versions of this API are defined in +_versioned_ client gems, with names of the form `google-cloud-saas_platform-saas_service_mgmt-v*`. +The gem `google-cloud-saas_platform-saas_service_mgmt` is the main client library that brings the +versioned gems in as dependencies, and provides high-level methods for +constructing clients. More information on versioned clients can be found below +in the section titled *Which client should I use?*. + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-saas_platform-saas_service_mgmt/latest) +for this library, google-cloud-saas_platform-saas_service_mgmt, to see the convenience methods for +constructing client objects. Reference documentation for the client objects +themselves can be found in the client library documentation for the versioned +client gems: +[google-cloud-saas_platform-saas_service_mgmt-v1beta1](https://cloud.google.com/ruby/docs/reference/google-cloud-saas_platform-saas_service_mgmt-v1beta1/latest). + +See also the [Product Documentation](https://cloud.google.com/saas-runtime/docs/overview) +for more usage information. + +## Quick Start + +``` +$ gem install google-cloud-saas_platform-saas_service_mgmt +``` + +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) + +```ruby +require "google/cloud/saas_platform/saas_service_mgmt" + +client = Google::Cloud::SaasPlatform::SaasServiceMgmt.saas_deployments +request = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListSaasRequest.new # (request fields as keyword arguments...) +response = client.list_saas request +``` + +## 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. + +Debug logging also requires that the versioned clients for this service be +sufficiently recent, released after about Dec 10, 2024. If logging is not +working, try updating the versioned clients in your bundle or installed gems: +[google-cloud-saas_platform-saas_service_mgmt-v1beta1](https://cloud.google.com/ruby/docs/reference/google-cloud-saas_platform-saas_service_mgmt-v1beta1/latest). + +## 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/Rakefile b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/Rakefile new file mode 100644 index 000000000000..10f8c02a616a --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/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 = true +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 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 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 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 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 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-saas_platform-saas_service_mgmt" + header "google-cloud-saas_platform-saas_service_mgmt rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-saas_platform-saas_service_mgmt yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-saas_platform-saas_service_mgmt 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 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 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/google-cloud-saas_platform-saas_service_mgmt.gemspec b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/google-cloud-saas_platform-saas_service_mgmt.gemspec new file mode 100644 index 000000000000..814d68313c65 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/google-cloud-saas_platform-saas_service_mgmt.gemspec @@ -0,0 +1,27 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/saas_platform/saas_service_mgmt/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-saas_platform-saas_service_mgmt" + gem.version = Google::Cloud::SaasPlatform::SaasServiceMgmt::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." + 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") + + ["README.md", "AUTHENTICATION.md", "LICENSE.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 3.0" + + gem.add_dependency "google-cloud-core", "~> 1.6" + gem.add_dependency "google-cloud-saas_platform-saas_service_mgmt-v1beta1", ">= 0.0", "< 2.a" +end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/lib/google-cloud-saas_platform-saas_service_mgmt.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/lib/google-cloud-saas_platform-saas_service_mgmt.rb new file mode 100644 index 000000000000..864dbb472e44 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/lib/google-cloud-saas_platform-saas_service_mgmt.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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" unless defined? Google::Cloud::SaasPlatform::SaasServiceMgmt::VERSION diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/lib/google/cloud/saas_platform/saas_service_mgmt.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/lib/google/cloud/saas_platform/saas_service_mgmt.rb new file mode 100644 index 000000000000..cfd06fa578f0 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/lib/google/cloud/saas_platform/saas_service_mgmt.rb @@ -0,0 +1,228 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# Require this file early so that the version constant gets defined before +# requiring "google/cloud". This is because google-cloud-core will load the +# entrypoint (gem name) file, which in turn re-requires this file (hence +# causing a require cycle) unless the version constant is already defined. +require "google/cloud/saas_platform/saas_service_mgmt/version" + +require "googleauth" +gem "google-cloud-core" +require "google/cloud" unless defined? ::Google::Cloud.new +require "google/cloud/config" + +# Set the default configuration +::Google::Cloud.configure.add_config! :saas_platform_saas_service_mgmt do |config| + config.add_field! :endpoint, nil, match: ::String + config.add_field! :credentials, nil, match: [::String, ::Hash, ::Google::Auth::Credentials] + config.add_field! :scope, nil, match: [::Array, ::String] + config.add_field! :lib_name, nil, match: ::String + config.add_field! :lib_version, nil, match: ::String + config.add_field! :interceptors, nil, match: ::Array + config.add_field! :timeout, nil, match: ::Numeric + config.add_field! :metadata, nil, match: ::Hash + config.add_field! :retry_policy, nil, match: [::Hash, ::Proc] + config.add_field! :quota_project, nil, match: ::String + config.add_field! :universe_domain, nil, match: ::String +end + +module Google + module Cloud + module SaasPlatform + module SaasServiceMgmt + ## + # Create a new client object for SaasDeployments. + # + # By default, this returns an instance of + # [Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-saas_platform-saas_service_mgmt-v1beta1/latest/Google-Cloud-SaasPlatform-SaasServiceMgmt-V1beta1-SaasDeployments-Client) + # for a gRPC client for version V1beta1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the SaasDeployments service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the SaasDeployments service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::SaasPlatform::SaasServiceMgmt.saas_deployments_available?}. + # + # ## About SaasDeployments + # + # Manages the deployment of SaaS services. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1beta1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.saas_deployments version: :v1beta1, transport: :grpc, &block + require "google/cloud/saas_platform/saas_service_mgmt/#{version.to_s.downcase}" + + package_name = Google::Cloud::SaasPlatform::SaasServiceMgmt + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::SaasPlatform::SaasServiceMgmt.const_get(package_name).const_get(:SaasDeployments) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the SaasDeployments service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::SaasPlatform::SaasServiceMgmt.saas_deployments}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the SaasDeployments service, + # or if the versioned client gem needs an update to support the SaasDeployments service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1beta1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.saas_deployments_available? version: :v1beta1, transport: :grpc + require "google/cloud/saas_platform/saas_service_mgmt/#{version.to_s.downcase}" + package_name = Google::Cloud::SaasPlatform::SaasServiceMgmt + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::SaasPlatform::SaasServiceMgmt.const_get package_name + return false unless service_module.const_defined? :SaasDeployments + service_module = service_module.const_get :SaasDeployments + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for SaasRollouts. + # + # By default, this returns an instance of + # [Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-saas_platform-saas_service_mgmt-v1beta1/latest/Google-Cloud-SaasPlatform-SaasServiceMgmt-V1beta1-SaasRollouts-Client) + # for a gRPC client for version V1beta1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the SaasRollouts service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the SaasRollouts service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::SaasPlatform::SaasServiceMgmt.saas_rollouts_available?}. + # + # ## About SaasRollouts + # + # Manages the rollout of SaaS services. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1beta1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.saas_rollouts version: :v1beta1, transport: :grpc, &block + require "google/cloud/saas_platform/saas_service_mgmt/#{version.to_s.downcase}" + + package_name = Google::Cloud::SaasPlatform::SaasServiceMgmt + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::SaasPlatform::SaasServiceMgmt.const_get(package_name).const_get(:SaasRollouts) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the SaasRollouts service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::SaasPlatform::SaasServiceMgmt.saas_rollouts}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the SaasRollouts service, + # or if the versioned client gem needs an update to support the SaasRollouts service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1beta1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.saas_rollouts_available? version: :v1beta1, transport: :grpc + require "google/cloud/saas_platform/saas_service_mgmt/#{version.to_s.downcase}" + package_name = Google::Cloud::SaasPlatform::SaasServiceMgmt + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::SaasPlatform::SaasServiceMgmt.const_get package_name + return false unless service_module.const_defined? :SaasRollouts + service_module = service_module.const_get :SaasRollouts + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Configure the google-cloud-saas_platform-saas_service_mgmt library. + # + # The following configuration parameters are supported: + # + # * `credentials` (*type:* `String, Hash, Google::Auth::Credentials`) - + # The path to the keyfile as a String, the contents of the keyfile as a + # Hash, or a Google::Auth::Credentials object. + # * `lib_name` (*type:* `String`) - + # The library name as recorded in instrumentation and logging. + # * `lib_version` (*type:* `String`) - + # The library version as recorded in instrumentation and logging. + # * `interceptors` (*type:* `Array`) - + # An array of interceptors that are run before calls are executed. + # * `timeout` (*type:* `Numeric`) - + # Default timeout in seconds. + # * `metadata` (*type:* `Hash{Symbol=>String}`) - + # Additional headers to be sent with the call. + # * `retry_policy` (*type:* `Hash`) - + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - + # The error codes that should trigger a retry. + # + # @return [::Google::Cloud::Config] The default configuration used by this library + # + def self.configure + yield ::Google::Cloud.configure.saas_platform_saas_service_mgmt if block_given? + + ::Google::Cloud.configure.saas_platform_saas_service_mgmt + end + end + end + end +end + +helper_path = ::File.join __dir__, "saas_service_mgmt", "helpers.rb" +require "google/cloud/saas_platform/saas_service_mgmt/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/lib/google/cloud/saas_platform/saas_service_mgmt/version.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/lib/google/cloud/saas_platform/saas_service_mgmt/version.rb new file mode 100644 index 000000000000..702f6d719d26 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/lib/google/cloud/saas_platform/saas_service_mgmt/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 SaasPlatform + module SaasServiceMgmt + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/test/google/cloud/saas_platform/saas_service_mgmt/client_test.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/test/google/cloud/saas_platform/saas_service_mgmt/client_test.rb new file mode 100644 index 000000000000..75a386d33524 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/test/google/cloud/saas_platform/saas_service_mgmt/client_test.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! + +require "helper" +require "google/cloud/saas_platform/saas_service_mgmt" +require "gapic/common" +require "gapic/grpc" +require "gapic/rest" + +class Google::Cloud::SaasPlatform::SaasServiceMgmt::ClientConstructionMinitest < 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_saas_deployments_grpc + skip unless Google::Cloud::SaasPlatform::SaasServiceMgmt.saas_deployments_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::SaasPlatform::SaasServiceMgmt.saas_deployments transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client, client + end + end + + def test_saas_deployments_rest + skip unless Google::Cloud::SaasPlatform::SaasServiceMgmt.saas_deployments_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::SaasPlatform::SaasServiceMgmt.saas_deployments transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client, client + end + end + + def test_saas_rollouts_grpc + skip unless Google::Cloud::SaasPlatform::SaasServiceMgmt.saas_rollouts_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::SaasPlatform::SaasServiceMgmt.saas_rollouts transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client, client + end + end + + def test_saas_rollouts_rest + skip unless Google::Cloud::SaasPlatform::SaasServiceMgmt.saas_rollouts_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::SaasPlatform::SaasServiceMgmt.saas_rollouts transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client, client + end + end +end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/test/google/cloud/saas_platform/saas_service_mgmt/version_test.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/test/google/cloud/saas_platform/saas_service_mgmt/version_test.rb new file mode 100644 index 000000000000..b5ea633ed383 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/test/google/cloud/saas_platform/saas_service_mgmt/version_test.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 "helper" +require "google/cloud/saas_platform/saas_service_mgmt/version" + +class Google::Cloud::SaasPlatform::SaasServiceMgmt::VersionMinitest < Minitest::Test + def test_has_a_version + refute_nil Google::Cloud::SaasPlatform::SaasServiceMgmt::VERSION + end +end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/test/helper.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/test/helper.rb new file mode 100644 index 000000000000..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" + +require "ostruct" 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..6442df18fa2f --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/Gemfile @@ -0,0 +1,11 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.31.1" +gem "minitest", "~> 5.22" +gem "minitest-focus", "~> 1.4" +gem "minitest-rg", "~> 5.3" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-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..b1b1c971b3b6 --- /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.1" + + 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..764d728f5d94 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloudscheduler_pb.rb @@ -0,0 +1,60 @@ +# 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 + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.scheduler.v1.Job", "google/cloud/scheduler/v1/job.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module 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..6aad88a26522 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/job_pb.rb @@ -0,0 +1,55 @@ +# 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 + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.scheduler.v1.PubsubTarget", "google/cloud/scheduler/v1/target.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ["google.protobuf.Duration", "google/protobuf/duration.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module 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..225bab1e093f --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/target_pb.rb @@ -0,0 +1,50 @@ +# 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 + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module 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..d59ba51a5612 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/api/client.rb @@ -0,0 +1,473 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] experimental_features + # @return [::Google::Api::PythonSettings::ExperimentalFeatures] + # Experimental features to be included during client library generation. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Experimental features to be included during client library generation. + # These fields will be deprecated once the feature graduates and is enabled + # by default. + # @!attribute [rw] rest_async_io_enabled + # @return [::Boolean] + # Enables generation of asynchronous REST clients if `rest` transport is + # enabled. By default, asynchronous REST clients will not be generated. + # This feature will be enabled by default 1 month after launching the + # feature in preview packages. + # @!attribute [rw] protobuf_pythonic_types_enabled + # @return [::Boolean] + # Enables generation of protobuf code using new types that are more + # Pythonic which are included in `protobuf>=5.29.x`. This feature will be + # enabled by default 1 month after launching the feature in preview + # packages. + # @!attribute [rw] unversioned_package_disabled + # @return [::Boolean] + # Disables generation of an unversioned Python package for this client + # library. This means that the module names will need to be versioned in + # import statements. For example `import google.cloud.library_v2` instead + # of `import google.cloud.library`. + class ExperimentalFeatures + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map of service names to renamed services. Keys are the package relative + # service names and values are the name to be used for the service client + # and call options. + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # + # Example: + # + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # This message is used to configure the generation of a subset of the RPCs in + # a service for client libraries. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/owl-bot-staging/google-cloud-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..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" + +require "ostruct" 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..6442df18fa2f --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/Gemfile @@ -0,0 +1,11 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.31.1" +gem "minitest", "~> 5.22" +gem "minitest-focus", "~> 1.4" +gem "minitest-rg", "~> 5.3" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-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..cfc2de299e77 --- /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.1" + + 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..58cd615ab281 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloudscheduler_pb.rb @@ -0,0 +1,60 @@ +# 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 + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.scheduler.v1beta1.Job", "google/cloud/scheduler/v1beta1/job.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module 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..f17ee354b46e --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/job_pb.rb @@ -0,0 +1,55 @@ +# 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 + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.scheduler.v1beta1.PubsubTarget", "google/cloud/scheduler/v1beta1/target.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ["google.protobuf.Duration", "google/protobuf/duration.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module 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..77ece4cc9400 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/target_pb.rb @@ -0,0 +1,50 @@ +# 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 + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module 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..d59ba51a5612 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/api/client.rb @@ -0,0 +1,473 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] experimental_features + # @return [::Google::Api::PythonSettings::ExperimentalFeatures] + # Experimental features to be included during client library generation. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Experimental features to be included during client library generation. + # These fields will be deprecated once the feature graduates and is enabled + # by default. + # @!attribute [rw] rest_async_io_enabled + # @return [::Boolean] + # Enables generation of asynchronous REST clients if `rest` transport is + # enabled. By default, asynchronous REST clients will not be generated. + # This feature will be enabled by default 1 month after launching the + # feature in preview packages. + # @!attribute [rw] protobuf_pythonic_types_enabled + # @return [::Boolean] + # Enables generation of protobuf code using new types that are more + # Pythonic which are included in `protobuf>=5.29.x`. This feature will be + # enabled by default 1 month after launching the feature in preview + # packages. + # @!attribute [rw] unversioned_package_disabled + # @return [::Boolean] + # Disables generation of an unversioned Python package for this client + # library. This means that the module names will need to be versioned in + # import statements. For example `import google.cloud.library_v2` instead + # of `import google.cloud.library`. + class ExperimentalFeatures + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map of service names to renamed services. Keys are the package relative + # service names and values are the name to be used for the service client + # and call options. + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # + # Example: + # + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # This message is used to configure the generation of a subset of the RPCs in + # a service for client libraries. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/owl-bot-staging/google-cloud-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..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1beta1/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" + +require "ostruct" diff --git a/owl-bot-staging/google-cloud-scheduler/.gitignore b/owl-bot-staging/google-cloud-scheduler/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler/.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/.repo-metadata.json b/owl-bot-staging/google-cloud-scheduler/.repo-metadata.json new file mode 100644 index 000000000000..fe18ddd5c2a0 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler/.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/latest", + "distribution_name": "google-cloud-scheduler", + "is_cloud": true, + "language": "ruby", + "name": "cloudscheduler", + "name_pretty": "Cloud Scheduler 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.", + "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/.rubocop.yml b/owl-bot-staging/google-cloud-scheduler/.rubocop.yml new file mode 100644 index 000000000000..8b70a3970a2e --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler/.rubocop.yml @@ -0,0 +1,39 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-scheduler.gemspec" + - "Rakefile" + - "acceptance/**/*" + - "test/**/*" + +Bundler/OrderedGems: + Enabled: false +Documentation: + Enabled: false +Layout/LineLength: + Enabled: false +Metrics/BlockLength: + Exclude: + - "samples/**/acceptance/*.rb" +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/FileName: + Exclude: + - "lib/google-cloud-scheduler.rb" + +Style/BlockDelimiters: + Exclude: + - "samples/**/acceptance/*.rb" diff --git a/owl-bot-staging/google-cloud-scheduler/.toys.rb b/owl-bot-staging/google-cloud-scheduler/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler/.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/.yardopts b/owl-bot-staging/google-cloud-scheduler/.yardopts new file mode 100644 index 000000000000..0a96e817b4db --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler/.yardopts @@ -0,0 +1,11 @@ +--no-private +--title="Cloud Scheduler API" +--exclude _pb\.rb$ +--markup markdown +--markup-provider redcarpet + +./lib/**/*.rb +- +README.md +AUTHENTICATION.md +LICENSE.md diff --git a/owl-bot-staging/google-cloud-scheduler/AUTHENTICATION.md b/owl-bot-staging/google-cloud-scheduler/AUTHENTICATION.md new file mode 100644 index 000000000000..2fc051ac6297 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-scheduler 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 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" + +client = Google::Cloud::Scheduler.cloud_scheduler do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/scheduler" + +Google::Cloud::Scheduler.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = Google::Cloud::Scheduler.cloud_scheduler +``` + +### 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 +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" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = Google::Cloud::Scheduler.cloud_scheduler +``` + +### 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/CHANGELOG.md b/owl-bot-staging/google-cloud-scheduler/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-scheduler/Gemfile b/owl-bot-staging/google-cloud-scheduler/Gemfile new file mode 100644 index 000000000000..45bcbc8bf1ff --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler/Gemfile @@ -0,0 +1,28 @@ +source "https://rubygems.org" + +gemspec + +local_dependencies = ["google-cloud-scheduler-v1"] + +main_spec = gemspecs.last || Bundler.load_gemspec(File.join(__dir__, "google-cloud-scheduler.gemspec")) +local_dependencies.each do |name| + spec_path = File.expand_path "../#{name}/#{name}.gemspec", __dir__ + unless File.file? spec_path + warn "WARNING: Disabled local dependency for #{name} because gemspec not found." + next + end + version = Bundler.load_gemspec(spec_path).version + if main_spec.dependencies.any? { |dep| dep.name == name && !dep.requirement.satisfied_by?(version) } + warn "WARNING: Disabled local dependency for #{name} because the gemspec disallows version #{version}." + next + end + gem name, path: "../#{name}" +end + +gem "google-style", "~> 1.30.1" +gem "minitest", "~> 5.22" +gem "minitest-focus", "~> 1.4" +gem "minitest-rg", "~> 5.3" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-scheduler/LICENSE.md b/owl-bot-staging/google-cloud-scheduler/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler/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/README.md b/owl-bot-staging/google-cloud-scheduler/README.md new file mode 100644 index 000000000000..a2cf39c345db --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler/README.md @@ -0,0 +1,142 @@ +# Ruby Client for the Cloud Scheduler API + +API Client library for the Cloud Scheduler API + +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. + +Actual client classes for the various versions of this API are defined in +_versioned_ client gems, with names of the form `google-cloud-scheduler-v*`. +The gem `google-cloud-scheduler` is the main client library that brings the +versioned gems in as dependencies, and provides high-level methods for +constructing clients. More information on versioned clients can be found below +in the section titled *Which client should I use?*. + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-scheduler/latest) +for this library, google-cloud-scheduler, to see the convenience methods for +constructing client objects. Reference documentation for the client objects +themselves can be found in the client library documentation for the versioned +client gems: +[google-cloud-scheduler-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1/latest). + +See also the [Product Documentation](https://cloud.google.com/scheduler) +for more usage information. + +## Quick Start + +``` +$ gem install google-cloud-scheduler +``` + +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) + +```ruby +require "google/cloud/scheduler" + +client = Google::Cloud::Scheduler.cloud_scheduler +request = ::Google::Cloud::Scheduler::V1::ListJobsRequest.new # (request fields as keyword arguments...) +response = client.list_jobs request +``` + +## 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. + +Debug logging also requires that the versioned clients for this service be +sufficiently recent, released after about Dec 10, 2024. If logging is not +working, try updating the versioned clients in your bundle or installed gems: +[google-cloud-scheduler-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1/latest). + +## 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/Rakefile b/owl-bot-staging/google-cloud-scheduler/Rakefile new file mode 100644 index 000000000000..ca517666c458 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler/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 = true +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 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 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 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 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 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-scheduler" + header "google-cloud-scheduler rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-scheduler yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-scheduler 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 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 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/google-cloud-scheduler.gemspec b/owl-bot-staging/google-cloud-scheduler/google-cloud-scheduler.gemspec new file mode 100644 index 000000000000..ca6963afbf73 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler/google-cloud-scheduler.gemspec @@ -0,0 +1,27 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/scheduler/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-scheduler" + gem.version = Google::Cloud::Scheduler::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." + gem.summary = "API Client library for the Cloud Scheduler 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") + + ["README.md", "AUTHENTICATION.md", "LICENSE.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 3.0" + + gem.add_dependency "google-cloud-core", "~> 1.6" + gem.add_dependency "google-cloud-scheduler-v1", "~> 1.2" +end diff --git a/owl-bot-staging/google-cloud-scheduler/lib/google-cloud-scheduler.rb b/owl-bot-staging/google-cloud-scheduler/lib/google-cloud-scheduler.rb new file mode 100644 index 000000000000..5dbd39bbc30f --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler/lib/google-cloud-scheduler.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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" unless defined? Google::Cloud::Scheduler::VERSION diff --git a/owl-bot-staging/google-cloud-scheduler/lib/google/cloud/scheduler.rb b/owl-bot-staging/google-cloud-scheduler/lib/google/cloud/scheduler.rb new file mode 100644 index 000000000000..a847287e7920 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler/lib/google/cloud/scheduler.rb @@ -0,0 +1,157 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# Require this file early so that the version constant gets defined before +# requiring "google/cloud". This is because google-cloud-core will load the +# entrypoint (gem name) file, which in turn re-requires this file (hence +# causing a require cycle) unless the version constant is already defined. +require "google/cloud/scheduler/version" + +require "googleauth" +gem "google-cloud-core" +require "google/cloud" unless defined? ::Google::Cloud.new +require "google/cloud/config" + +# Set the default configuration +::Google::Cloud.configure.add_config! :scheduler do |config| + config.add_field! :endpoint, nil, match: ::String + config.add_field! :credentials, nil, match: [::String, ::Hash, ::Google::Auth::Credentials] + config.add_field! :scope, nil, match: [::Array, ::String] + config.add_field! :lib_name, nil, match: ::String + config.add_field! :lib_version, nil, match: ::String + config.add_field! :interceptors, nil, match: ::Array + config.add_field! :timeout, nil, match: ::Numeric + config.add_field! :metadata, nil, match: ::Hash + config.add_field! :retry_policy, nil, match: [::Hash, ::Proc] + config.add_field! :quota_project, nil, match: ::String + config.add_field! :universe_domain, nil, match: ::String +end + +module Google + module Cloud + module Scheduler + ## + # Create a new client object for CloudScheduler. + # + # By default, this returns an instance of + # [Google::Cloud::Scheduler::V1::CloudScheduler::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1/latest/Google-Cloud-Scheduler-V1-CloudScheduler-Client) + # for a gRPC client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the CloudScheduler service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the CloudScheduler service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Scheduler.cloud_scheduler_available?}. + # + # ## About CloudScheduler + # + # The Cloud Scheduler API allows external entities to reliably + # schedule asynchronous jobs. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.cloud_scheduler version: :v1, transport: :grpc, &block + require "google/cloud/scheduler/#{version.to_s.downcase}" + + package_name = Google::Cloud::Scheduler + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Scheduler.const_get(package_name).const_get(:CloudScheduler) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the CloudScheduler service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Scheduler.cloud_scheduler}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the CloudScheduler service, + # or if the versioned client gem needs an update to support the CloudScheduler service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.cloud_scheduler_available? version: :v1, transport: :grpc + require "google/cloud/scheduler/#{version.to_s.downcase}" + package_name = Google::Cloud::Scheduler + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Scheduler.const_get package_name + return false unless service_module.const_defined? :CloudScheduler + service_module = service_module.const_get :CloudScheduler + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Configure the google-cloud-scheduler library. + # + # The following configuration parameters are supported: + # + # * `credentials` (*type:* `String, Hash, Google::Auth::Credentials`) - + # The path to the keyfile as a String, the contents of the keyfile as a + # Hash, or a Google::Auth::Credentials object. + # * `lib_name` (*type:* `String`) - + # The library name as recorded in instrumentation and logging. + # * `lib_version` (*type:* `String`) - + # The library version as recorded in instrumentation and logging. + # * `interceptors` (*type:* `Array`) - + # An array of interceptors that are run before calls are executed. + # * `timeout` (*type:* `Numeric`) - + # Default timeout in seconds. + # * `metadata` (*type:* `Hash{Symbol=>String}`) - + # Additional headers to be sent with the call. + # * `retry_policy` (*type:* `Hash`) - + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - + # The error codes that should trigger a retry. + # + # @return [::Google::Cloud::Config] The default configuration used by this library + # + def self.configure + yield ::Google::Cloud.configure.scheduler if block_given? + + ::Google::Cloud.configure.scheduler + end + end + end +end + +helper_path = ::File.join __dir__, "scheduler", "helpers.rb" +require "google/cloud/scheduler/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-scheduler/lib/google/cloud/scheduler/version.rb b/owl-bot-staging/google-cloud-scheduler/lib/google/cloud/scheduler/version.rb new file mode 100644 index 000000000000..c4e8d11ea4bc --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler/lib/google/cloud/scheduler/version.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! + + +module Google + module Cloud + module Scheduler + VERSION = "0.0.1" + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler/test/google/cloud/scheduler/client_test.rb b/owl-bot-staging/google-cloud-scheduler/test/google/cloud/scheduler/client_test.rb new file mode 100644 index 000000000000..5ab48d5d0553 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler/test/google/cloud/scheduler/client_test.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 "helper" +require "google/cloud/scheduler" +require "gapic/common" +require "gapic/grpc" +require "gapic/rest" + +class Google::Cloud::Scheduler::ClientConstructionMinitest < 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_cloud_scheduler_grpc + skip unless Google::Cloud::Scheduler.cloud_scheduler_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::Scheduler.cloud_scheduler transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::Scheduler::V1::CloudScheduler::Client, client + end + end + + def test_cloud_scheduler_rest + skip unless Google::Cloud::Scheduler.cloud_scheduler_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Scheduler.cloud_scheduler transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client, client + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler/test/google/cloud/scheduler/version_test.rb b/owl-bot-staging/google-cloud-scheduler/test/google/cloud/scheduler/version_test.rb new file mode 100644 index 000000000000..02bfe3ac6be4 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler/test/google/cloud/scheduler/version_test.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 "helper" +require "google/cloud/scheduler/version" + +class Google::Cloud::Scheduler::VersionMinitest < Minitest::Test + def test_has_a_version + refute_nil Google::Cloud::Scheduler::VERSION + end +end diff --git a/owl-bot-staging/google-cloud-scheduler/test/helper.rb b/owl-bot-staging/google-cloud-scheduler/test/helper.rb new file mode 100644 index 000000000000..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" + +require "ostruct" 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..6442df18fa2f --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/Gemfile @@ -0,0 +1,11 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.31.1" +gem "minitest", "~> 5.22" +gem "minitest-focus", "~> 1.4" +gem "minitest-rg", "~> 5.3" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-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..fcfd382fc96e --- /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.1" + + 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..09df9c991633 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secretmanager/v1/resources_pb.rb @@ -0,0 +1,64 @@ +# 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 + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.protobuf.Duration", "google/protobuf/duration.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module 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..ce2e7a443885 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secretmanager/v1/service_pb.rb @@ -0,0 +1,68 @@ +# 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: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] experimental_features + # @return [::Google::Api::PythonSettings::ExperimentalFeatures] + # Experimental features to be included during client library generation. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Experimental features to be included during client library generation. + # These fields will be deprecated once the feature graduates and is enabled + # by default. + # @!attribute [rw] rest_async_io_enabled + # @return [::Boolean] + # Enables generation of asynchronous REST clients if `rest` transport is + # enabled. By default, asynchronous REST clients will not be generated. + # This feature will be enabled by default 1 month after launching the + # feature in preview packages. + # @!attribute [rw] protobuf_pythonic_types_enabled + # @return [::Boolean] + # Enables generation of protobuf code using new types that are more + # Pythonic which are included in `protobuf>=5.29.x`. This feature will be + # enabled by default 1 month after launching the feature in preview + # packages. + # @!attribute [rw] unversioned_package_disabled + # @return [::Boolean] + # Disables generation of an unversioned Python package for this client + # library. This means that the module names will need to be versioned in + # import statements. For example `import google.cloud.library_v2` instead + # of `import google.cloud.library`. + class ExperimentalFeatures + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map of service names to renamed services. Keys are the package relative + # service names and values are the name to be used for the service client + # and call options. + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # + # Example: + # + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # This message is used to configure the generation of a subset of the RPCs in + # a service for client libraries. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/owl-bot-staging/google-cloud-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..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" + +require "ostruct" 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..6442df18fa2f --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/Gemfile @@ -0,0 +1,11 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.31.1" +gem "minitest", "~> 5.22" +gem "minitest-focus", "~> 1.4" +gem "minitest-rg", "~> 5.3" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-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..0606f2b840f3 --- /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.1" + + 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..8868c322d3b9 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secrets/v1beta1/resources_pb.rb @@ -0,0 +1,54 @@ +# 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 + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module 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..c3109624dbec --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secrets/v1beta1/service_pb.rb @@ -0,0 +1,68 @@ +# 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 + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.secrets.v1beta1.Secret", "google/cloud/secrets/v1beta1/resources.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module 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..d59ba51a5612 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/api/client.rb @@ -0,0 +1,473 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] experimental_features + # @return [::Google::Api::PythonSettings::ExperimentalFeatures] + # Experimental features to be included during client library generation. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Experimental features to be included during client library generation. + # These fields will be deprecated once the feature graduates and is enabled + # by default. + # @!attribute [rw] rest_async_io_enabled + # @return [::Boolean] + # Enables generation of asynchronous REST clients if `rest` transport is + # enabled. By default, asynchronous REST clients will not be generated. + # This feature will be enabled by default 1 month after launching the + # feature in preview packages. + # @!attribute [rw] protobuf_pythonic_types_enabled + # @return [::Boolean] + # Enables generation of protobuf code using new types that are more + # Pythonic which are included in `protobuf>=5.29.x`. This feature will be + # enabled by default 1 month after launching the feature in preview + # packages. + # @!attribute [rw] unversioned_package_disabled + # @return [::Boolean] + # Disables generation of an unversioned Python package for this client + # library. This means that the module names will need to be versioned in + # import statements. For example `import google.cloud.library_v2` instead + # of `import google.cloud.library`. + class ExperimentalFeatures + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map of service names to renamed services. Keys are the package relative + # service names and values are the name to be used for the service client + # and call options. + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # + # Example: + # + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # This message is used to configure the generation of a subset of the RPCs in + # a service for client libraries. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/owl-bot-staging/google-cloud-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..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta1/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" + +require "ostruct" 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..6442df18fa2f --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/Gemfile @@ -0,0 +1,11 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.31.1" +gem "minitest", "~> 5.22" +gem "minitest-focus", "~> 1.4" +gem "minitest-rg", "~> 5.3" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-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..8a4625b0efb0 --- /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.1" + + 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..014897ad23f7 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secretmanager/v1beta2/resources_pb.rb @@ -0,0 +1,64 @@ +# 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 + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.protobuf.Duration", "google/protobuf/duration.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module 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..7921e025f19a --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secretmanager/v1beta2/service_pb.rb @@ -0,0 +1,68 @@ +# 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 + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.secretmanager.v1beta2.Secret", "google/cloud/secretmanager/v1beta2/resources.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module 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..d59ba51a5612 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/api/client.rb @@ -0,0 +1,473 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] experimental_features + # @return [::Google::Api::PythonSettings::ExperimentalFeatures] + # Experimental features to be included during client library generation. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Experimental features to be included during client library generation. + # These fields will be deprecated once the feature graduates and is enabled + # by default. + # @!attribute [rw] rest_async_io_enabled + # @return [::Boolean] + # Enables generation of asynchronous REST clients if `rest` transport is + # enabled. By default, asynchronous REST clients will not be generated. + # This feature will be enabled by default 1 month after launching the + # feature in preview packages. + # @!attribute [rw] protobuf_pythonic_types_enabled + # @return [::Boolean] + # Enables generation of protobuf code using new types that are more + # Pythonic which are included in `protobuf>=5.29.x`. This feature will be + # enabled by default 1 month after launching the feature in preview + # packages. + # @!attribute [rw] unversioned_package_disabled + # @return [::Boolean] + # Disables generation of an unversioned Python package for this client + # library. This means that the module names will need to be versioned in + # import statements. For example `import google.cloud.library_v2` instead + # of `import google.cloud.library`. + class ExperimentalFeatures + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map of service names to renamed services. Keys are the package relative + # service names and values are the name to be used for the service client + # and call options. + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # + # Example: + # + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # This message is used to configure the generation of a subset of the RPCs in + # a service for client libraries. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/owl-bot-staging/google-cloud-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..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1beta2/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" + +require "ostruct" diff --git a/owl-bot-staging/google-cloud-secret_manager/.gitignore b/owl-bot-staging/google-cloud-secret_manager/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager/.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/.repo-metadata.json b/owl-bot-staging/google-cloud-secret_manager/.repo-metadata.json new file mode 100644 index 000000000000..2841043a0679 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager/.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/latest", + "distribution_name": "google-cloud-secret_manager", + "is_cloud": true, + "language": "ruby", + "name": "secretmanager", + "name_pretty": "Secret Manager 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.", + "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/.rubocop.yml b/owl-bot-staging/google-cloud-secret_manager/.rubocop.yml new file mode 100644 index 000000000000..f23c496220e0 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager/.rubocop.yml @@ -0,0 +1,39 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-secret_manager.gemspec" + - "Rakefile" + - "acceptance/**/*" + - "test/**/*" + +Bundler/OrderedGems: + Enabled: false +Documentation: + Enabled: false +Layout/LineLength: + Enabled: false +Metrics/BlockLength: + Exclude: + - "samples/**/acceptance/*.rb" +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/FileName: + Exclude: + - "lib/google-cloud-secret_manager.rb" + +Style/BlockDelimiters: + Exclude: + - "samples/**/acceptance/*.rb" diff --git a/owl-bot-staging/google-cloud-secret_manager/.toys.rb b/owl-bot-staging/google-cloud-secret_manager/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager/.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/.yardopts b/owl-bot-staging/google-cloud-secret_manager/.yardopts new file mode 100644 index 000000000000..124a053abd98 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager/.yardopts @@ -0,0 +1,11 @@ +--no-private +--title="Secret Manager API" +--exclude _pb\.rb$ +--markup markdown +--markup-provider redcarpet + +./lib/**/*.rb +- +README.md +AUTHENTICATION.md +LICENSE.md diff --git a/owl-bot-staging/google-cloud-secret_manager/AUTHENTICATION.md b/owl-bot-staging/google-cloud-secret_manager/AUTHENTICATION.md new file mode 100644 index 000000000000..7fd185b48c4a --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-secret_manager 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 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" + +client = Google::Cloud::SecretManager.secret_manager_service do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/secret_manager" + +Google::Cloud::SecretManager.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = Google::Cloud::SecretManager.secret_manager_service +``` + +### 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 +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" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = Google::Cloud::SecretManager.secret_manager_service +``` + +### 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/CHANGELOG.md b/owl-bot-staging/google-cloud-secret_manager/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-secret_manager/Gemfile b/owl-bot-staging/google-cloud-secret_manager/Gemfile new file mode 100644 index 000000000000..801e1a94d618 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager/Gemfile @@ -0,0 +1,28 @@ +source "https://rubygems.org" + +gemspec + +local_dependencies = ["google-cloud-secret_manager-v1"] + +main_spec = gemspecs.last || Bundler.load_gemspec(File.join(__dir__, "google-cloud-secret_manager.gemspec")) +local_dependencies.each do |name| + spec_path = File.expand_path "../#{name}/#{name}.gemspec", __dir__ + unless File.file? spec_path + warn "WARNING: Disabled local dependency for #{name} because gemspec not found." + next + end + version = Bundler.load_gemspec(spec_path).version + if main_spec.dependencies.any? { |dep| dep.name == name && !dep.requirement.satisfied_by?(version) } + warn "WARNING: Disabled local dependency for #{name} because the gemspec disallows version #{version}." + next + end + gem name, path: "../#{name}" +end + +gem "google-style", "~> 1.30.1" +gem "minitest", "~> 5.22" +gem "minitest-focus", "~> 1.4" +gem "minitest-rg", "~> 5.3" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-secret_manager/LICENSE.md b/owl-bot-staging/google-cloud-secret_manager/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager/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/README.md b/owl-bot-staging/google-cloud-secret_manager/README.md new file mode 100644 index 000000000000..d02c416d3958 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager/README.md @@ -0,0 +1,142 @@ +# Ruby Client for the Secret Manager API + +API Client library for the Secret Manager API + +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. + +Actual client classes for the various versions of this API are defined in +_versioned_ client gems, with names of the form `google-cloud-secret_manager-v*`. +The gem `google-cloud-secret_manager` is the main client library that brings the +versioned gems in as dependencies, and provides high-level methods for +constructing clients. More information on versioned clients can be found below +in the section titled *Which client should I use?*. + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-secret_manager/latest) +for this library, google-cloud-secret_manager, to see the convenience methods for +constructing client objects. Reference documentation for the client objects +themselves can be found in the client library documentation for the versioned +client gems: +[google-cloud-secret_manager-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1/latest). + +See also the [Product Documentation](https://cloud.google.com/secret-manager) +for more usage information. + +## Quick Start + +``` +$ gem install google-cloud-secret_manager +``` + +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) + +```ruby +require "google/cloud/secret_manager" + +client = Google::Cloud::SecretManager.secret_manager_service +request = ::Google::Cloud::SecretManager::V1::ListSecretsRequest.new # (request fields as keyword arguments...) +response = client.list_secrets request +``` + +## 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. + +Debug logging also requires that the versioned clients for this service be +sufficiently recent, released after about Dec 10, 2024. If logging is not +working, try updating the versioned clients in your bundle or installed gems: +[google-cloud-secret_manager-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1/latest). + +## 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/Rakefile b/owl-bot-staging/google-cloud-secret_manager/Rakefile new file mode 100644 index 000000000000..fde45ed3739d --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager/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 = true +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 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 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 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 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 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-secret_manager" + header "google-cloud-secret_manager rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-secret_manager yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-secret_manager 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 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 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/google-cloud-secret_manager.gemspec b/owl-bot-staging/google-cloud-secret_manager/google-cloud-secret_manager.gemspec new file mode 100644 index 000000000000..9edde2a47779 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager/google-cloud-secret_manager.gemspec @@ -0,0 +1,27 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/secret_manager/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-secret_manager" + gem.version = Google::Cloud::SecretManager::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." + gem.summary = "API Client library for the Secret Manager 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") + + ["README.md", "AUTHENTICATION.md", "LICENSE.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 3.0" + + gem.add_dependency "google-cloud-core", "~> 1.6" + gem.add_dependency "google-cloud-secret_manager-v1", "~> 1.2" +end diff --git a/owl-bot-staging/google-cloud-secret_manager/lib/google-cloud-secret_manager.rb b/owl-bot-staging/google-cloud-secret_manager/lib/google-cloud-secret_manager.rb new file mode 100644 index 000000000000..ed54373735d2 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager/lib/google-cloud-secret_manager.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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" unless defined? Google::Cloud::SecretManager::VERSION diff --git a/owl-bot-staging/google-cloud-secret_manager/lib/google/cloud/secret_manager.rb b/owl-bot-staging/google-cloud-secret_manager/lib/google/cloud/secret_manager.rb new file mode 100644 index 000000000000..23b7ef7b669d --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager/lib/google/cloud/secret_manager.rb @@ -0,0 +1,153 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# Require this file early so that the version constant gets defined before +# requiring "google/cloud". This is because google-cloud-core will load the +# entrypoint (gem name) file, which in turn re-requires this file (hence +# causing a require cycle) unless the version constant is already defined. +require "google/cloud/secret_manager/version" + +require "googleauth" +gem "google-cloud-core" +require "google/cloud" unless defined? ::Google::Cloud.new +require "google/cloud/config" + +# Set the default configuration +::Google::Cloud.configure.add_config! :secret_manager do |config| + config.add_field! :endpoint, nil, match: ::String + config.add_field! :credentials, nil, match: [::String, ::Hash, ::Google::Auth::Credentials] + config.add_field! :scope, nil, match: [::Array, ::String] + config.add_field! :lib_name, nil, match: ::String + config.add_field! :lib_version, nil, match: ::String + config.add_field! :interceptors, nil, match: ::Array + config.add_field! :timeout, nil, match: ::Numeric + config.add_field! :metadata, nil, match: ::Hash + config.add_field! :retry_policy, nil, match: [::Hash, ::Proc] + config.add_field! :quota_project, nil, match: ::String + config.add_field! :universe_domain, nil, match: ::String +end + +module Google + module Cloud + module SecretManager + ## + # Create a new client object for SecretManagerService. + # + # By default, this returns an instance of + # [Google::Cloud::SecretManager::V1::SecretManagerService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1/latest/Google-Cloud-SecretManager-V1-SecretManagerService-Client) + # for a gRPC client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the SecretManagerService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the SecretManagerService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::SecretManager.secret_manager_service_available?}. + # + # ## About SecretManagerService + # + # Secret Manager Service + # + # Manages secrets and operations using those secrets. Implements a REST + # model with the following objects: + # + # * Secret + # * SecretVersion + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.secret_manager_service version: :v1, &block + require "google/cloud/secret_manager/#{version.to_s.downcase}" + + package_name = Google::Cloud::SecretManager + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::SecretManager.const_get(package_name).const_get(:SecretManagerService) + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the SecretManagerService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::SecretManager.secret_manager_service}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the SecretManagerService service, + # or if the versioned client gem needs an update to support the SecretManagerService service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.secret_manager_service_available? version: :v1 + require "google/cloud/secret_manager/#{version.to_s.downcase}" + package_name = Google::Cloud::SecretManager + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::SecretManager.const_get package_name + return false unless service_module.const_defined? :SecretManagerService + service_module = service_module.const_get :SecretManagerService + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Configure the google-cloud-secret_manager library. + # + # The following configuration parameters are supported: + # + # * `credentials` (*type:* `String, Hash, Google::Auth::Credentials`) - + # The path to the keyfile as a String, the contents of the keyfile as a + # Hash, or a Google::Auth::Credentials object. + # * `lib_name` (*type:* `String`) - + # The library name as recorded in instrumentation and logging. + # * `lib_version` (*type:* `String`) - + # The library version as recorded in instrumentation and logging. + # * `interceptors` (*type:* `Array`) - + # An array of interceptors that are run before calls are executed. + # * `timeout` (*type:* `Numeric`) - + # Default timeout in seconds. + # * `metadata` (*type:* `Hash{Symbol=>String}`) - + # Additional headers to be sent with the call. + # * `retry_policy` (*type:* `Hash`) - + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - + # The error codes that should trigger a retry. + # + # @return [::Google::Cloud::Config] The default configuration used by this library + # + def self.configure + yield ::Google::Cloud.configure.secret_manager if block_given? + + ::Google::Cloud.configure.secret_manager + end + end + end +end + +helper_path = ::File.join __dir__, "secret_manager", "helpers.rb" +require "google/cloud/secret_manager/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-secret_manager/lib/google/cloud/secret_manager/version.rb b/owl-bot-staging/google-cloud-secret_manager/lib/google/cloud/secret_manager/version.rb new file mode 100644 index 000000000000..7ca62e39649f --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager/lib/google/cloud/secret_manager/version.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! + + +module Google + module Cloud + module SecretManager + VERSION = "0.0.1" + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager/test/google/cloud/secret_manager/client_test.rb b/owl-bot-staging/google-cloud-secret_manager/test/google/cloud/secret_manager/client_test.rb new file mode 100644 index 000000000000..9bf24e4ef2a7 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager/test/google/cloud/secret_manager/client_test.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 "helper" +require "google/cloud/secret_manager" +require "gapic/common" +require "gapic/grpc" + +class Google::Cloud::SecretManager::ClientConstructionMinitest < 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_secret_manager_service_grpc + skip unless Google::Cloud::SecretManager.secret_manager_service_available? + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::SecretManager.secret_manager_service do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::SecretManager::V1::SecretManagerService::Client, client + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager/test/google/cloud/secret_manager/version_test.rb b/owl-bot-staging/google-cloud-secret_manager/test/google/cloud/secret_manager/version_test.rb new file mode 100644 index 000000000000..7188a10c49e1 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager/test/google/cloud/secret_manager/version_test.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 "helper" +require "google/cloud/secret_manager/version" + +class Google::Cloud::SecretManager::VersionMinitest < Minitest::Test + def test_has_a_version + refute_nil Google::Cloud::SecretManager::VERSION + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager/test/helper.rb b/owl-bot-staging/google-cloud-secret_manager/test/helper.rb new file mode 100644 index 000000000000..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" + +require "ostruct" 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..6442df18fa2f --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/Gemfile @@ -0,0 +1,11 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.31.1" +gem "minitest", "~> 5.22" +gem "minitest-focus", "~> 1.4" +gem "minitest-rg", "~> 5.3" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-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..f5de10c34478 --- /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.1" + + 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..d89058573db8 --- /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,148 @@ +# 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 + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module 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..d59ba51a5612 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/api/client.rb @@ -0,0 +1,473 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] experimental_features + # @return [::Google::Api::PythonSettings::ExperimentalFeatures] + # Experimental features to be included during client library generation. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Experimental features to be included during client library generation. + # These fields will be deprecated once the feature graduates and is enabled + # by default. + # @!attribute [rw] rest_async_io_enabled + # @return [::Boolean] + # Enables generation of asynchronous REST clients if `rest` transport is + # enabled. By default, asynchronous REST clients will not be generated. + # This feature will be enabled by default 1 month after launching the + # feature in preview packages. + # @!attribute [rw] protobuf_pythonic_types_enabled + # @return [::Boolean] + # Enables generation of protobuf code using new types that are more + # Pythonic which are included in `protobuf>=5.29.x`. This feature will be + # enabled by default 1 month after launching the feature in preview + # packages. + # @!attribute [rw] unversioned_package_disabled + # @return [::Boolean] + # Disables generation of an unversioned Python package for this client + # library. This means that the module names will need to be versioned in + # import statements. For example `import google.cloud.library_v2` instead + # of `import google.cloud.library`. + class ExperimentalFeatures + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map of service names to renamed services. Keys are the package relative + # service names and values are the name to be used for the service client + # and call options. + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # + # Example: + # + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # This message is used to configure the generation of a subset of the RPCs in + # a service for client libraries. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/owl-bot-staging/google-cloud-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..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager-v1/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" + +require "ostruct" diff --git a/owl-bot-staging/google-cloud-secure_source_manager/.gitignore b/owl-bot-staging/google-cloud-secure_source_manager/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager/.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/.repo-metadata.json b/owl-bot-staging/google-cloud-secure_source_manager/.repo-metadata.json new file mode 100644 index 000000000000..c96017f17418 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager/.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/latest", + "distribution_name": "google-cloud-secure_source_manager", + "is_cloud": true, + "language": "ruby", + "name": "securesourcemanager", + "name_pretty": "Secure Source Manager 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.", + "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/.rubocop.yml b/owl-bot-staging/google-cloud-secure_source_manager/.rubocop.yml new file mode 100644 index 000000000000..39706a9e0bfe --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager/.rubocop.yml @@ -0,0 +1,39 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-secure_source_manager.gemspec" + - "Rakefile" + - "acceptance/**/*" + - "test/**/*" + +Bundler/OrderedGems: + Enabled: false +Documentation: + Enabled: false +Layout/LineLength: + Enabled: false +Metrics/BlockLength: + Exclude: + - "samples/**/acceptance/*.rb" +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/FileName: + Exclude: + - "lib/google-cloud-secure_source_manager.rb" + +Style/BlockDelimiters: + Exclude: + - "samples/**/acceptance/*.rb" diff --git a/owl-bot-staging/google-cloud-secure_source_manager/.toys.rb b/owl-bot-staging/google-cloud-secure_source_manager/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager/.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/.yardopts b/owl-bot-staging/google-cloud-secure_source_manager/.yardopts new file mode 100644 index 000000000000..5c99ec81c960 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager/.yardopts @@ -0,0 +1,11 @@ +--no-private +--title="Secure Source Manager API" +--exclude _pb\.rb$ +--markup markdown +--markup-provider redcarpet + +./lib/**/*.rb +- +README.md +AUTHENTICATION.md +LICENSE.md diff --git a/owl-bot-staging/google-cloud-secure_source_manager/AUTHENTICATION.md b/owl-bot-staging/google-cloud-secure_source_manager/AUTHENTICATION.md new file mode 100644 index 000000000000..70e84a04d138 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-secure_source_manager 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 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" + +client = Google::Cloud::SecureSourceManager.secure_source_manager 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" + +Google::Cloud::SecureSourceManager.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = Google::Cloud::SecureSourceManager.secure_source_manager +``` + +### 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 +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" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = Google::Cloud::SecureSourceManager.secure_source_manager +``` + +### 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/CHANGELOG.md b/owl-bot-staging/google-cloud-secure_source_manager/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-secure_source_manager/Gemfile b/owl-bot-staging/google-cloud-secure_source_manager/Gemfile new file mode 100644 index 000000000000..8dd2f3e61bd5 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager/Gemfile @@ -0,0 +1,28 @@ +source "https://rubygems.org" + +gemspec + +local_dependencies = ["google-cloud-secure_source_manager-v1"] + +main_spec = gemspecs.last || Bundler.load_gemspec(File.join(__dir__, "google-cloud-secure_source_manager.gemspec")) +local_dependencies.each do |name| + spec_path = File.expand_path "../#{name}/#{name}.gemspec", __dir__ + unless File.file? spec_path + warn "WARNING: Disabled local dependency for #{name} because gemspec not found." + next + end + version = Bundler.load_gemspec(spec_path).version + if main_spec.dependencies.any? { |dep| dep.name == name && !dep.requirement.satisfied_by?(version) } + warn "WARNING: Disabled local dependency for #{name} because the gemspec disallows version #{version}." + next + end + gem name, path: "../#{name}" +end + +gem "google-style", "~> 1.30.1" +gem "minitest", "~> 5.22" +gem "minitest-focus", "~> 1.4" +gem "minitest-rg", "~> 5.3" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-secure_source_manager/LICENSE.md b/owl-bot-staging/google-cloud-secure_source_manager/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager/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/README.md b/owl-bot-staging/google-cloud-secure_source_manager/README.md new file mode 100644 index 000000000000..626209d4b024 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager/README.md @@ -0,0 +1,142 @@ +# Ruby Client for the Secure Source Manager 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. + +Actual client classes for the various versions of this API are defined in +_versioned_ client gems, with names of the form `google-cloud-secure_source_manager-v*`. +The gem `google-cloud-secure_source_manager` is the main client library that brings the +versioned gems in as dependencies, and provides high-level methods for +constructing clients. More information on versioned clients can be found below +in the section titled *Which client should I use?*. + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-secure_source_manager/latest) +for this library, google-cloud-secure_source_manager, to see the convenience methods for +constructing client objects. Reference documentation for the client objects +themselves can be found in the client library documentation for the versioned +client gems: +[google-cloud-secure_source_manager-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-secure_source_manager-v1/latest). + +See also the [Product Documentation](https://cloud.google.com/secure-source-manager/docs/overview) +for more usage information. + +## Quick Start + +``` +$ gem install google-cloud-secure_source_manager +``` + +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) + +```ruby +require "google/cloud/secure_source_manager" + +client = Google::Cloud::SecureSourceManager.secure_source_manager +request = ::Google::Cloud::SecureSourceManager::V1::ListInstancesRequest.new # (request fields as keyword arguments...) +response = client.list_instances request +``` + +## 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. + +Debug logging also requires that the versioned clients for this service be +sufficiently recent, released after about Dec 10, 2024. If logging is not +working, try updating the versioned clients in your bundle or installed gems: +[google-cloud-secure_source_manager-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-secure_source_manager-v1/latest). + +## 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/Rakefile b/owl-bot-staging/google-cloud-secure_source_manager/Rakefile new file mode 100644 index 000000000000..c7970accf7b4 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager/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 = true +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 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 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 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 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 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-secure_source_manager" + header "google-cloud-secure_source_manager rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-secure_source_manager yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-secure_source_manager 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 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 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/google-cloud-secure_source_manager.gemspec b/owl-bot-staging/google-cloud-secure_source_manager/google-cloud-secure_source_manager.gemspec new file mode 100644 index 000000000000..e662ca03a727 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager/google-cloud-secure_source_manager.gemspec @@ -0,0 +1,27 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/secure_source_manager/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-secure_source_manager" + gem.version = Google::Cloud::SecureSourceManager::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." + 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") + + ["README.md", "AUTHENTICATION.md", "LICENSE.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 3.0" + + gem.add_dependency "google-cloud-core", "~> 1.6" + gem.add_dependency "google-cloud-secure_source_manager-v1", "~> 2.0" +end diff --git a/owl-bot-staging/google-cloud-secure_source_manager/lib/google-cloud-secure_source_manager.rb b/owl-bot-staging/google-cloud-secure_source_manager/lib/google-cloud-secure_source_manager.rb new file mode 100644 index 000000000000..268a417c2881 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager/lib/google-cloud-secure_source_manager.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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" unless defined? Google::Cloud::SecureSourceManager::VERSION diff --git a/owl-bot-staging/google-cloud-secure_source_manager/lib/google/cloud/secure_source_manager.rb b/owl-bot-staging/google-cloud-secure_source_manager/lib/google/cloud/secure_source_manager.rb new file mode 100644 index 000000000000..d303d76e6126 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager/lib/google/cloud/secure_source_manager.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 this file early so that the version constant gets defined before +# requiring "google/cloud". This is because google-cloud-core will load the +# entrypoint (gem name) file, which in turn re-requires this file (hence +# causing a require cycle) unless the version constant is already defined. +require "google/cloud/secure_source_manager/version" + +require "googleauth" +gem "google-cloud-core" +require "google/cloud" unless defined? ::Google::Cloud.new +require "google/cloud/config" + +# Set the default configuration +::Google::Cloud.configure.add_config! :secure_source_manager do |config| + config.add_field! :endpoint, nil, match: ::String + config.add_field! :credentials, nil, match: [::String, ::Hash, ::Google::Auth::Credentials] + config.add_field! :scope, nil, match: [::Array, ::String] + config.add_field! :lib_name, nil, match: ::String + config.add_field! :lib_version, nil, match: ::String + config.add_field! :interceptors, nil, match: ::Array + config.add_field! :timeout, nil, match: ::Numeric + config.add_field! :metadata, nil, match: ::Hash + config.add_field! :retry_policy, nil, match: [::Hash, ::Proc] + config.add_field! :quota_project, nil, match: ::String + config.add_field! :universe_domain, nil, match: ::String +end + +module Google + module Cloud + module SecureSourceManager + ## + # Create a new client object for SecureSourceManager. + # + # By default, this returns an instance of + # [Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-secure_source_manager-v1/latest/Google-Cloud-SecureSourceManager-V1-SecureSourceManager-Client) + # for a gRPC client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the SecureSourceManager service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the SecureSourceManager service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::SecureSourceManager.secure_source_manager_available?}. + # + # ## About SecureSourceManager + # + # Secure Source Manager API + # + # Access Secure Source Manager instances, resources, and repositories. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.secure_source_manager version: :v1, transport: :grpc, &block + require "google/cloud/secure_source_manager/#{version.to_s.downcase}" + + package_name = Google::Cloud::SecureSourceManager + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::SecureSourceManager.const_get(package_name).const_get(:SecureSourceManager) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the SecureSourceManager service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::SecureSourceManager.secure_source_manager}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the SecureSourceManager service, + # or if the versioned client gem needs an update to support the SecureSourceManager service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.secure_source_manager_available? version: :v1, transport: :grpc + require "google/cloud/secure_source_manager/#{version.to_s.downcase}" + package_name = Google::Cloud::SecureSourceManager + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::SecureSourceManager.const_get package_name + return false unless service_module.const_defined? :SecureSourceManager + service_module = service_module.const_get :SecureSourceManager + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Configure the google-cloud-secure_source_manager library. + # + # The following configuration parameters are supported: + # + # * `credentials` (*type:* `String, Hash, Google::Auth::Credentials`) - + # The path to the keyfile as a String, the contents of the keyfile as a + # Hash, or a Google::Auth::Credentials object. + # * `lib_name` (*type:* `String`) - + # The library name as recorded in instrumentation and logging. + # * `lib_version` (*type:* `String`) - + # The library version as recorded in instrumentation and logging. + # * `interceptors` (*type:* `Array`) - + # An array of interceptors that are run before calls are executed. + # * `timeout` (*type:* `Numeric`) - + # Default timeout in seconds. + # * `metadata` (*type:* `Hash{Symbol=>String}`) - + # Additional headers to be sent with the call. + # * `retry_policy` (*type:* `Hash`) - + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - + # The error codes that should trigger a retry. + # + # @return [::Google::Cloud::Config] The default configuration used by this library + # + def self.configure + yield ::Google::Cloud.configure.secure_source_manager if block_given? + + ::Google::Cloud.configure.secure_source_manager + end + end + end +end + +helper_path = ::File.join __dir__, "secure_source_manager", "helpers.rb" +require "google/cloud/secure_source_manager/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-secure_source_manager/lib/google/cloud/secure_source_manager/version.rb b/owl-bot-staging/google-cloud-secure_source_manager/lib/google/cloud/secure_source_manager/version.rb new file mode 100644 index 000000000000..3e29de4e1fc7 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager/lib/google/cloud/secure_source_manager/version.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! + + +module Google + module Cloud + module SecureSourceManager + VERSION = "0.0.1" + end + end +end diff --git a/owl-bot-staging/google-cloud-secure_source_manager/test/google/cloud/secure_source_manager/client_test.rb b/owl-bot-staging/google-cloud-secure_source_manager/test/google/cloud/secure_source_manager/client_test.rb new file mode 100644 index 000000000000..190212437d4c --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager/test/google/cloud/secure_source_manager/client_test.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 "helper" +require "google/cloud/secure_source_manager" +require "gapic/common" +require "gapic/grpc" +require "gapic/rest" + +class Google::Cloud::SecureSourceManager::ClientConstructionMinitest < 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_secure_source_manager_grpc + skip unless Google::Cloud::SecureSourceManager.secure_source_manager_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::SecureSourceManager.secure_source_manager transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client, client + end + end + + def test_secure_source_manager_rest + skip unless Google::Cloud::SecureSourceManager.secure_source_manager_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::SecureSourceManager.secure_source_manager transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client, client + end + end +end diff --git a/owl-bot-staging/google-cloud-secure_source_manager/test/google/cloud/secure_source_manager/version_test.rb b/owl-bot-staging/google-cloud-secure_source_manager/test/google/cloud/secure_source_manager/version_test.rb new file mode 100644 index 000000000000..bd800a9c364b --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager/test/google/cloud/secure_source_manager/version_test.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 "helper" +require "google/cloud/secure_source_manager/version" + +class Google::Cloud::SecureSourceManager::VersionMinitest < Minitest::Test + def test_has_a_version + refute_nil Google::Cloud::SecureSourceManager::VERSION + end +end diff --git a/owl-bot-staging/google-cloud-secure_source_manager/test/helper.rb b/owl-bot-staging/google-cloud-secure_source_manager/test/helper.rb new file mode 100644 index 000000000000..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-secure_source_manager/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" + +require "ostruct" 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..6442df18fa2f --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/Gemfile @@ -0,0 +1,11 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.31.1" +gem "minitest", "~> 5.22" +gem "minitest-focus", "~> 1.4" +gem "minitest-rg", "~> 5.3" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-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..41395182ee5c --- /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.1" + + 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..6bac8662d5d4 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/privateca/v1/resources_pb.rb @@ -0,0 +1,104 @@ +# 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 + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Duration", "google/protobuf/duration.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.type.Expr", "google/type/expr.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module 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..f376a66b6bcb --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/privateca/v1/service_pb.rb @@ -0,0 +1,95 @@ +# 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 + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.security.privateca.v1.Certificate", "google/cloud/security/privateca/v1/resources.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module 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..d59ba51a5612 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/api/client.rb @@ -0,0 +1,473 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] experimental_features + # @return [::Google::Api::PythonSettings::ExperimentalFeatures] + # Experimental features to be included during client library generation. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Experimental features to be included during client library generation. + # These fields will be deprecated once the feature graduates and is enabled + # by default. + # @!attribute [rw] rest_async_io_enabled + # @return [::Boolean] + # Enables generation of asynchronous REST clients if `rest` transport is + # enabled. By default, asynchronous REST clients will not be generated. + # This feature will be enabled by default 1 month after launching the + # feature in preview packages. + # @!attribute [rw] protobuf_pythonic_types_enabled + # @return [::Boolean] + # Enables generation of protobuf code using new types that are more + # Pythonic which are included in `protobuf>=5.29.x`. This feature will be + # enabled by default 1 month after launching the feature in preview + # packages. + # @!attribute [rw] unversioned_package_disabled + # @return [::Boolean] + # Disables generation of an unversioned Python package for this client + # library. This means that the module names will need to be versioned in + # import statements. For example `import google.cloud.library_v2` instead + # of `import google.cloud.library`. + class ExperimentalFeatures + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map of service names to renamed services. Keys are the package relative + # service names and values are the name to be used for the service client + # and call options. + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # + # Example: + # + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # This message is used to configure the generation of a subset of the RPCs in + # a service for client libraries. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/owl-bot-staging/google-cloud-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..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-security-private_ca-v1/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" + +require "ostruct" From 5ea5ac0bd928eb96001b434fc5f020098e8329fe Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Mon, 5 Jan 2026 22:31:42 +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 --- .../AUTHENTICATION.md | 20 +- .../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 | 11 - .../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 | 94 - .../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 | 473 -- .../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 | 25 - .../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 | 11 - .../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 | 91 - .../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 | 473 -- .../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 | 25 - owl-bot-staging/google-cloud-redis/.gitignore | 22 - .../google-cloud-redis/.repo-metadata.json | 18 - .../google-cloud-redis/.rubocop.yml | 39 - owl-bot-staging/google-cloud-redis/.toys.rb | 28 - owl-bot-staging/google-cloud-redis/.yardopts | 11 - .../google-cloud-redis/AUTHENTICATION.md | 122 - .../google-cloud-redis/CHANGELOG.md | 2 - owl-bot-staging/google-cloud-redis/Gemfile | 28 - owl-bot-staging/google-cloud-redis/LICENSE.md | 201 - owl-bot-staging/google-cloud-redis/README.md | 142 - owl-bot-staging/google-cloud-redis/Rakefile | 169 - .../google-cloud-redis.gemspec | 27 - .../lib/google-cloud-redis.rb | 19 - .../lib/google/cloud/redis.rb | 170 - .../lib/google/cloud/redis/version.rb | 26 - .../test/google/cloud/redis/client_test.rb | 64 - .../test/google/cloud/redis/version_test.rb | 26 - .../google-cloud-redis/test/helper.rb | 25 - .../.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 | 11 - .../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 | 70 - .../resourcemanager/v3/folders_services_pb.rb | 172 - .../resourcemanager/v3/organizations_pb.rb | 57 - .../v3/organizations_services_pb.rb | 73 - .../cloud/resourcemanager/v3/projects_pb.rb | 70 - .../v3/projects_services_pb.rb | 190 - .../resourcemanager/v3/tag_bindings_pb.rb | 58 - .../v3/tag_bindings_services_pb.rb | 57 - .../cloud/resourcemanager/v3/tag_holds_pb.rb | 57 - .../v3/tag_holds_services_pb.rb | 54 - .../cloud/resourcemanager/v3/tag_keys_pb.rb | 65 - .../v3/tag_keys_services_pb.rb | 81 - .../cloud/resourcemanager/v3/tag_values_pb.rb | 64 - .../v3/tag_values_services_pb.rb | 81 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 473 -- .../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 | 25 - .../google-cloud-resource_manager/.gitignore | 22 - .../.repo-metadata.json | 15 - .../.rubocop.yml | 39 - .../google-cloud-resource_manager/.toys.rb | 28 - .../google-cloud-resource_manager/.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../google-cloud-resource_manager/Gemfile | 28 - .../google-cloud-resource_manager/LICENSE.md | 201 - .../google-cloud-resource_manager/README.md | 147 - .../google-cloud-resource_manager/Rakefile | 169 - .../google-cloud-resource_manager.gemspec | 27 - .../lib/google-cloud-resource_manager.rb | 19 - .../lib/google/cloud/resource_manager.rb | 583 -- .../google/cloud/resource_manager/version.rb | 26 - .../cloud/resource_manager/client_test.rb | 190 - .../cloud/resource_manager/version_test.rb | 26 - .../test/helper.rb | 25 - .../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 | 11 - .../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 | 48 - .../v2/analytics_service_services_pb.rb | 49 - .../lib/google/cloud/retail/v2/catalog_pb.rb | 66 - .../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 | 66 - .../retail/v2/catalog_service_services_pb.rb | 125 - .../lib/google/cloud/retail/v2/common_pb.rb | 80 - .../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 | 55 - .../v2/completion_service_services_pb.rb | 61 - .../lib/google/cloud/retail/v2/control_pb.rb | 47 - .../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 | 57 - .../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 | 65 - ...nversational_search_service_services_pb.rb | 52 - .../cloud/retail/v2/export_config_pb.rb | 58 - .../cloud/retail/v2/generative_question_pb.rb | 45 - .../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 | 57 - ...generative_question_service_services_pb.rb | 55 - .../cloud/retail/v2/import_config_pb.rb | 73 - .../lib/google/cloud/retail/v2/model_pb.rb | 56 - .../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 | 64 - .../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 | 53 - .../v2/prediction_service_services_pb.rb | 45 - .../lib/google/cloud/retail/v2/product_pb.rb | 59 - .../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 | 79 - .../retail/v2/product_service_services_pb.rb | 248 - .../google/cloud/retail/v2/promotion_pb.rb | 42 - .../google/cloud/retail/v2/purge_config_pb.rb | 52 - .../lib/google/cloud/retail/v2/rest.rb | 48 - .../lib/google/cloud/retail/v2/safety_pb.rb | 47 - .../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 | 86 - .../retail/v2/search_service_services_pb.rb | 51 - .../cloud/retail/v2/serving_config_pb.rb | 49 - .../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 | 59 - .../v2/serving_config_service_services_pb.rb | 74 - .../google/cloud/retail/v2/user_event_pb.rb | 55 - .../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 | 58 - .../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 | 473 -- .../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 | 121 - .../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 | 25 - .../google-cloud-retail/.gitignore | 22 - .../google-cloud-retail/.repo-metadata.json | 18 - .../google-cloud-retail/.rubocop.yml | 39 - owl-bot-staging/google-cloud-retail/.toys.rb | 28 - owl-bot-staging/google-cloud-retail/.yardopts | 11 - .../google-cloud-retail/AUTHENTICATION.md | 122 - .../google-cloud-retail/CHANGELOG.md | 2 - owl-bot-staging/google-cloud-retail/Gemfile | 28 - .../google-cloud-retail/LICENSE.md | 201 - owl-bot-staging/google-cloud-retail/README.md | 142 - owl-bot-staging/google-cloud-retail/Rakefile | 169 - .../google-cloud-retail.gemspec | 27 - .../lib/google-cloud-retail.rb | 19 - .../lib/google/cloud/retail.rb | 949 --- .../lib/google/cloud/retail/version.rb | 26 - .../test/google/cloud/retail/client_test.rb | 295 - .../test/google/cloud/retail/version_test.rb | 26 - .../google-cloud-retail/test/helper.rb | 25 - .../google-cloud-run-client/.gitignore | 22 - .../.repo-metadata.json | 17 - .../google-cloud-run-client/.rubocop.yml | 39 - .../google-cloud-run-client/.toys.rb | 28 - .../google-cloud-run-client/.yardopts | 11 - .../google-cloud-run-client/AUTHENTICATION.md | 122 - .../google-cloud-run-client/CHANGELOG.md | 2 - .../google-cloud-run-client/Gemfile | 28 - .../google-cloud-run-client/LICENSE.md | 201 - .../google-cloud-run-client/README.md | 142 - .../google-cloud-run-client/Rakefile | 169 - .../google-cloud-run.gemspec | 27 - .../lib/google-cloud-run.rb | 19 - .../lib/google/cloud/run.rb | 576 -- .../lib/google/cloud/run/version.rb | 26 - .../test/google/cloud/run/client_test.rb | 190 - .../test/google/cloud/run/version_test.rb | 26 - .../google-cloud-run-client/test/helper.rb | 25 - .../.gitignore | 22 - .../.repo-metadata.json | 17 - .../.rubocop.yml | 33 - .../.toys.rb | 28 - .../.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../Gemfile | 11 - .../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 | 58 - .../v1beta1/deployments_resources_pb.rb | 73 - .../v1beta1/deployments_service_pb.rb | 89 - .../deployments_service_services_pb.rb | 105 - .../v1beta1/rollouts_resources_pb.rb | 60 - .../v1beta1/rollouts_service_pb.rb | 65 - .../v1beta1/rollouts_service_services_pb.rb | 65 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 473 -- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/field_info.rb | 88 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../saasservicemgmt/v1beta1/common.rb | 231 - .../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 | 25 - .../.gitignore | 22 - .../.repo-metadata.json | 17 - .../.rubocop.yml | 39 - .../.toys.rb | 28 - .../.yardopts | 11 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../Gemfile | 28 - .../LICENSE.md | 201 - .../README.md | 142 - .../Rakefile | 169 - ...ud-saas_platform-saas_service_mgmt.gemspec | 27 - ...e-cloud-saas_platform-saas_service_mgmt.rb | 19 - .../cloud/saas_platform/saas_service_mgmt.rb | 228 - .../saas_service_mgmt/version.rb | 28 - .../saas_service_mgmt/client_test.rb | 85 - .../saas_service_mgmt/version_test.rb | 26 - .../test/helper.rb | 25 - .../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 | 11 - .../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 | 60 - .../v1/cloudscheduler_services_pb.rb | 89 - .../lib/google/cloud/scheduler/v1/job_pb.rb | 55 - .../lib/google/cloud/scheduler/v1/rest.rb | 38 - .../google/cloud/scheduler/v1/target_pb.rb | 50 - .../lib/google/cloud/scheduler/v1/version.rb | 28 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 473 -- .../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 | 25 - .../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 | 11 - .../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 | 60 - .../v1beta1/cloudscheduler_services_pb.rb | 92 - .../google/cloud/scheduler/v1beta1/job_pb.rb | 55 - .../google/cloud/scheduler/v1beta1/rest.rb | 38 - .../cloud/scheduler/v1beta1/target_pb.rb | 50 - .../google/cloud/scheduler/v1beta1/version.rb | 28 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 473 -- .../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 | 25 - .../google-cloud-scheduler/.gitignore | 22 - .../.repo-metadata.json | 18 - .../google-cloud-scheduler/.rubocop.yml | 39 - .../google-cloud-scheduler/.toys.rb | 28 - .../google-cloud-scheduler/.yardopts | 11 - .../google-cloud-scheduler/AUTHENTICATION.md | 122 - .../google-cloud-scheduler/CHANGELOG.md | 2 - .../google-cloud-scheduler/Gemfile | 28 - .../google-cloud-scheduler/LICENSE.md | 201 - .../google-cloud-scheduler/README.md | 142 - .../google-cloud-scheduler/Rakefile | 169 - .../google-cloud-scheduler.gemspec | 27 - .../lib/google-cloud-scheduler.rb | 19 - .../lib/google/cloud/scheduler.rb | 157 - .../lib/google/cloud/scheduler/version.rb | 26 - .../google/cloud/scheduler/client_test.rb | 64 - .../google/cloud/scheduler/version_test.rb | 26 - .../google-cloud-scheduler/test/helper.rb | 25 - .../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 | 11 - .../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 | 64 - .../cloud/secretmanager/v1/service_pb.rb | 68 - .../secretmanager/v1/service_services_pb.rb | 118 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 473 -- .../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 | 25 - .../.gitignore | 22 - .../.repo-metadata.json | 18 - .../.rubocop.yml | 33 - .../.toys.rb | 28 - .../.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../Gemfile | 11 - .../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 | 54 - .../cloud/secrets/v1beta1/service_pb.rb | 68 - .../secrets/v1beta1/service_services_pb.rb | 117 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 473 -- .../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 | 25 - .../.gitignore | 22 - .../.repo-metadata.json | 18 - .../.rubocop.yml | 33 - .../.toys.rb | 28 - .../.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../Gemfile | 11 - .../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 | 64 - .../cloud/secretmanager/v1beta2/service_pb.rb | 68 - .../v1beta2/service_services_pb.rb | 125 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 473 -- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/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 | 25 - .../google-cloud-secret_manager/.gitignore | 22 - .../.repo-metadata.json | 18 - .../google-cloud-secret_manager/.rubocop.yml | 39 - .../google-cloud-secret_manager/.toys.rb | 28 - .../google-cloud-secret_manager/.yardopts | 11 - .../AUTHENTICATION.md | 122 - .../google-cloud-secret_manager/CHANGELOG.md | 2 - .../google-cloud-secret_manager/Gemfile | 28 - .../google-cloud-secret_manager/LICENSE.md | 201 - .../google-cloud-secret_manager/README.md | 142 - .../google-cloud-secret_manager/Rakefile | 169 - .../google-cloud-secret_manager.gemspec | 27 - .../lib/google-cloud-secret_manager.rb | 19 - .../lib/google/cloud/secret_manager.rb | 153 - .../google/cloud/secret_manager/version.rb | 26 - .../cloud/secret_manager/client_test.rb | 53 - .../cloud/secret_manager/version_test.rb | 26 - .../test/helper.rb | 25 - .../.gitignore | 22 - .../.repo-metadata.json | 17 - .../.rubocop.yml | 33 - .../.toys.rb | 28 - .../.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../Gemfile | 11 - .../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 | 148 - .../v1/secure_source_manager_services_pb.rb | 170 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 473 -- .../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 | 25 - .../.gitignore | 22 - .../.repo-metadata.json | 17 - .../.rubocop.yml | 39 - .../.toys.rb | 28 - .../.yardopts | 11 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../Gemfile | 28 - .../LICENSE.md | 201 - .../README.md | 142 - .../Rakefile | 169 - ...google-cloud-secure_source_manager.gemspec | 27 - .../lib/google-cloud-secure_source_manager.rb | 19 - .../lib/google/cloud/secure_source_manager.rb | 158 - .../cloud/secure_source_manager/version.rb | 26 - .../secure_source_manager/client_test.rb | 64 - .../secure_source_manager/version_test.rb | 26 - .../test/helper.rb | 25 - .../.gitignore | 22 - .../.repo-metadata.json | 18 - .../.rubocop.yml | 33 - .../.toys.rb | 28 - .../.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../Gemfile | 11 - .../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 | 104 - .../cloud/security/privateca/v1/service_pb.rb | 95 - .../privateca/v1/service_services_pb.rb | 150 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 473 -- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/field_info.rb | 88 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../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 | 25 - 1350 files changed, 2 insertions(+), 305656 deletions(-) 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-redis/.gitignore delete mode 100644 owl-bot-staging/google-cloud-redis/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-redis/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-redis/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-redis/.yardopts delete mode 100644 owl-bot-staging/google-cloud-redis/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-redis/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-redis/Gemfile delete mode 100644 owl-bot-staging/google-cloud-redis/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-redis/README.md delete mode 100644 owl-bot-staging/google-cloud-redis/Rakefile delete mode 100644 owl-bot-staging/google-cloud-redis/google-cloud-redis.gemspec delete mode 100644 owl-bot-staging/google-cloud-redis/lib/google-cloud-redis.rb delete mode 100644 owl-bot-staging/google-cloud-redis/lib/google/cloud/redis.rb delete mode 100644 owl-bot-staging/google-cloud-redis/lib/google/cloud/redis/version.rb delete mode 100644 owl-bot-staging/google-cloud-redis/test/google/cloud/redis/client_test.rb delete mode 100644 owl-bot-staging/google-cloud-redis/test/google/cloud/redis/version_test.rb delete mode 100644 owl-bot-staging/google-cloud-redis/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-resource_manager/.gitignore delete mode 100644 owl-bot-staging/google-cloud-resource_manager/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-resource_manager/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-resource_manager/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager/.yardopts delete mode 100644 owl-bot-staging/google-cloud-resource_manager/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-resource_manager/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-resource_manager/Gemfile delete mode 100644 owl-bot-staging/google-cloud-resource_manager/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-resource_manager/README.md delete mode 100644 owl-bot-staging/google-cloud-resource_manager/Rakefile delete mode 100644 owl-bot-staging/google-cloud-resource_manager/google-cloud-resource_manager.gemspec delete mode 100644 owl-bot-staging/google-cloud-resource_manager/lib/google-cloud-resource_manager.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager/lib/google/cloud/resource_manager.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager/lib/google/cloud/resource_manager/version.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager/test/google/cloud/resource_manager/client_test.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager/test/google/cloud/resource_manager/version_test.rb delete mode 100644 owl-bot-staging/google-cloud-resource_manager/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-retail/.gitignore delete mode 100644 owl-bot-staging/google-cloud-retail/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-retail/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-retail/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-retail/.yardopts delete mode 100644 owl-bot-staging/google-cloud-retail/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-retail/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-retail/Gemfile delete mode 100644 owl-bot-staging/google-cloud-retail/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-retail/README.md delete mode 100644 owl-bot-staging/google-cloud-retail/Rakefile delete mode 100644 owl-bot-staging/google-cloud-retail/google-cloud-retail.gemspec delete mode 100644 owl-bot-staging/google-cloud-retail/lib/google-cloud-retail.rb delete mode 100644 owl-bot-staging/google-cloud-retail/lib/google/cloud/retail.rb delete mode 100644 owl-bot-staging/google-cloud-retail/lib/google/cloud/retail/version.rb delete mode 100644 owl-bot-staging/google-cloud-retail/test/google/cloud/retail/client_test.rb delete mode 100644 owl-bot-staging/google-cloud-retail/test/google/cloud/retail/version_test.rb delete mode 100644 owl-bot-staging/google-cloud-retail/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-run-client/.gitignore delete mode 100644 owl-bot-staging/google-cloud-run-client/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-run-client/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-run-client/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-run-client/.yardopts delete mode 100644 owl-bot-staging/google-cloud-run-client/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-run-client/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-run-client/Gemfile delete mode 100644 owl-bot-staging/google-cloud-run-client/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-run-client/README.md delete mode 100644 owl-bot-staging/google-cloud-run-client/Rakefile delete mode 100644 owl-bot-staging/google-cloud-run-client/google-cloud-run.gemspec delete mode 100644 owl-bot-staging/google-cloud-run-client/lib/google-cloud-run.rb delete mode 100644 owl-bot-staging/google-cloud-run-client/lib/google/cloud/run.rb delete mode 100644 owl-bot-staging/google-cloud-run-client/lib/google/cloud/run/version.rb delete mode 100644 owl-bot-staging/google-cloud-run-client/test/google/cloud/run/client_test.rb delete mode 100644 owl-bot-staging/google-cloud-run-client/test/google/cloud/run/version_test.rb delete mode 100644 owl-bot-staging/google-cloud-run-client/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-saas_platform-saas_service_mgmt/.gitignore delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/.yardopts delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/Gemfile delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/README.md delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/Rakefile delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/google-cloud-saas_platform-saas_service_mgmt.gemspec delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/lib/google-cloud-saas_platform-saas_service_mgmt.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/lib/google/cloud/saas_platform/saas_service_mgmt.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/lib/google/cloud/saas_platform/saas_service_mgmt/version.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/test/google/cloud/saas_platform/saas_service_mgmt/client_test.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/test/google/cloud/saas_platform/saas_service_mgmt/version_test.rb delete mode 100644 owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/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-scheduler/.gitignore delete mode 100644 owl-bot-staging/google-cloud-scheduler/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-scheduler/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-scheduler/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler/.yardopts delete mode 100644 owl-bot-staging/google-cloud-scheduler/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-scheduler/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-scheduler/Gemfile delete mode 100644 owl-bot-staging/google-cloud-scheduler/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-scheduler/README.md delete mode 100644 owl-bot-staging/google-cloud-scheduler/Rakefile delete mode 100644 owl-bot-staging/google-cloud-scheduler/google-cloud-scheduler.gemspec delete mode 100644 owl-bot-staging/google-cloud-scheduler/lib/google-cloud-scheduler.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler/lib/google/cloud/scheduler.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler/lib/google/cloud/scheduler/version.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler/test/google/cloud/scheduler/client_test.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler/test/google/cloud/scheduler/version_test.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler/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-secret_manager/.gitignore delete mode 100644 owl-bot-staging/google-cloud-secret_manager/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-secret_manager/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-secret_manager/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager/.yardopts delete mode 100644 owl-bot-staging/google-cloud-secret_manager/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-secret_manager/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-secret_manager/Gemfile delete mode 100644 owl-bot-staging/google-cloud-secret_manager/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-secret_manager/README.md delete mode 100644 owl-bot-staging/google-cloud-secret_manager/Rakefile delete mode 100644 owl-bot-staging/google-cloud-secret_manager/google-cloud-secret_manager.gemspec delete mode 100644 owl-bot-staging/google-cloud-secret_manager/lib/google-cloud-secret_manager.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager/lib/google/cloud/secret_manager.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager/lib/google/cloud/secret_manager/version.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager/test/google/cloud/secret_manager/client_test.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager/test/google/cloud/secret_manager/version_test.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager/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-secure_source_manager/.gitignore delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager/.yardopts delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager/Gemfile delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager/README.md delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager/Rakefile delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager/google-cloud-secure_source_manager.gemspec delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager/lib/google-cloud-secure_source_manager.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager/lib/google/cloud/secure_source_manager.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager/lib/google/cloud/secure_source_manager/version.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager/test/google/cloud/secure_source_manager/client_test.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager/test/google/cloud/secure_source_manager/version_test.rb delete mode 100644 owl-bot-staging/google-cloud-secure_source_manager/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 diff --git a/google-cloud-resource_manager/AUTHENTICATION.md b/google-cloud-resource_manager/AUTHENTICATION.md index 63cb1f139590..a0127ab5179c 100644 --- a/google-cloud-resource_manager/AUTHENTICATION.md +++ b/google-cloud-resource_manager/AUTHENTICATION.md @@ -33,12 +33,6 @@ credentials, there are several methods available to you. Credentials are accepted in the following ways, in the following order or precedence: -> [!WARNING] -> If you accept a credential configuration (JSON file or Hash) from an -> external source for authentication to Google Cloud, you must validate it before -> providing it to a Google API client library. Providing an unvalidated credential -> configuration to Google APIs can compromise the security of your systems and data. - 1. Credentials specified in method arguments 2. Credentials specified in configuration 3. Credentials pointed to or included in environment variables @@ -60,30 +54,20 @@ whenever possible. To configure a credentials file for an individual client initialization: ```ruby -require "googleauth" require "google/cloud/resource_manager" -credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - json_key_io: ::File.open("/path/to/keyfile.json") -) - client = Google::Cloud::ResourceManager.folders do |config| - config.credentials = credentials + config.credentials = "path/to/credentialfile.json" end ``` To configure a credentials file globally for all clients: ```ruby -require "googleauth" require "google/cloud/resource_manager" -credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - json_key_io: ::File.open("/path/to/keyfile.json") -) - Google::Cloud::ResourceManager.configure do |config| - config.credentials = credentials + config.credentials = "path/to/credentialfile.json" end client = Google::Cloud::ResourceManager.folders 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 6442df18fa2f..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/Gemfile +++ /dev/null @@ -1,11 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.31.1" -gem "minitest", "~> 5.22" -gem "minitest-focus", "~> 1.4" -gem "minitest-rg", "~> 5.3" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-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 3a409c712627..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.1" - - 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 52470c44018e..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/lib/google/cloud/redis/v1/cloud_redis_pb.rb +++ /dev/null @@ -1,94 +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 - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.type.TimeOfDay", "google/type/timeofday.proto"], - ["google.protobuf.Duration", "google/protobuf/duration.proto"], - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module 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 d59ba51a5612..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,473 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 - # @!attribute [rw] service_class_names - # @return [::Google::Protobuf::Map{::String => ::String}] - # Configure the Java class name to use instead of the service's for its - # corresponding generated GAPIC client. Keys are fully-qualified - # service names as they appear in the protobuf (including the full - # the language_settings.java.interface_names" field in gapic.yaml. API - # teams should otherwise use the service name as it appears in the - # protobuf. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class JavaSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ServiceClassNamesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for C++ client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class CppSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Php client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class PhpSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Python client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] experimental_features - # @return [::Google::Api::PythonSettings::ExperimentalFeatures] - # Experimental features to be included during client library generation. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Experimental features to be included during client library generation. - # These fields will be deprecated once the feature graduates and is enabled - # by default. - # @!attribute [rw] rest_async_io_enabled - # @return [::Boolean] - # Enables generation of asynchronous REST clients if `rest` transport is - # enabled. By default, asynchronous REST clients will not be generated. - # This feature will be enabled by default 1 month after launching the - # feature in preview packages. - # @!attribute [rw] protobuf_pythonic_types_enabled - # @return [::Boolean] - # Enables generation of protobuf code using new types that are more - # Pythonic which are included in `protobuf>=5.29.x`. This feature will be - # enabled by default 1 month after launching the feature in preview - # packages. - # @!attribute [rw] unversioned_package_disabled - # @return [::Boolean] - # Disables generation of an unversioned Python package for this client - # library. This means that the module names will need to be versioned in - # import statements. For example `import google.cloud.library_v2` instead - # of `import google.cloud.library`. - class ExperimentalFeatures - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Node client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class NodeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Dotnet client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from original service names to renamed versions. - # This is used when the default generated types - # would cause a naming conflict. (Neither name is - # fully-qualified.) - # Example: Subscriber to SubscriberServiceApi. - # @!attribute [rw] renamed_resources - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from full resource types to the effective short name - # for the resource. This is used when otherwise resource - # named from different services would cause naming collisions. - # Example entry: - # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - # @!attribute [rw] ignored_resources - # @return [::Array<::String>] - # List of full resource types to ignore during generation. - # This is typically used for API-specific Location resources, - # which should be handled by the generator as if they were actually - # the common Location resources. - # Example entry: "documentai.googleapis.com/Location" - # @!attribute [rw] forced_namespace_aliases - # @return [::Array<::String>] - # Namespaces which must be aliased in snippets due to - # a known (but non-generator-predictable) naming collision - # @!attribute [rw] handwritten_signatures - # @return [::Array<::String>] - # Method signatures (in the form "service.method(signature)") - # which are provided separately, so shouldn't be generated. - # Snippets *calling* these methods are still generated, however. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedResourcesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Ruby client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class RubySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Go client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map of service names to renamed services. Keys are the package relative - # service names and values are the name to be used for the service client - # and call options. - # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Describes the generator configuration for a method. - # @!attribute [rw] selector - # @return [::String] - # The fully qualified name of the method, for which the options below apply. - # This is used to find the method to apply the options. - # - # Example: - # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... - # @!attribute [rw] long_running - # @return [::Google::Api::MethodSettings::LongRunning] - # Describes settings to use for long-running operations when generating - # API methods for RPCs. Complements RPCs that use the annotations in - # google/longrunning/operations.proto. - # - # Example of a YAML configuration:: - # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes - # @!attribute [rw] auto_populated_fields - # @return [::Array<::String>] - # List of top-level fields of the request message, that should be - # automatically populated by the client libraries based on their - # (google.api.field_info).format. Currently supported format: UUID4. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id - class MethodSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes settings to use when generating API methods that use the - # long-running operation pattern. - # All default values below are from those used in the client library - # generators (e.g. - # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). - # @!attribute [rw] initial_poll_delay - # @return [::Google::Protobuf::Duration] - # Initial delay after which the first poll request will be made. - # Default value: 5 seconds. - # @!attribute [rw] poll_delay_multiplier - # @return [::Float] - # Multiplier to gradually increase delay between subsequent polls until it - # reaches max_poll_delay. - # Default value: 1.5. - # @!attribute [rw] max_poll_delay - # @return [::Google::Protobuf::Duration] - # Maximum time between two subsequent poll requests. - # Default value: 45 seconds. - # @!attribute [rw] total_poll_timeout - # @return [::Google::Protobuf::Duration] - # Total polling timeout. - # Default value: 5 minutes. - class LongRunning - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # This message is used to configure the generation of a subset of the RPCs in - # a service for client libraries. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - end -end diff --git a/owl-bot-staging/google-cloud-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 f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/rg" - -require "grpc" - -require "ostruct" 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 6442df18fa2f..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/Gemfile +++ /dev/null @@ -1,11 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.31.1" -gem "minitest", "~> 5.22" -gem "minitest-focus", "~> 1.4" -gem "minitest-rg", "~> 5.3" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-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 cb00dcb15690..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.1" - - 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 085c79bde265..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/lib/google/cloud/redis/v1beta1/cloud_redis_pb.rb +++ /dev/null @@ -1,91 +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 - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.type.TimeOfDay", "google/type/timeofday.proto"], - ["google.protobuf.Duration", "google/protobuf/duration.proto"], - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module 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 d59ba51a5612..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,473 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 - # @!attribute [rw] service_class_names - # @return [::Google::Protobuf::Map{::String => ::String}] - # Configure the Java class name to use instead of the service's for its - # corresponding generated GAPIC client. Keys are fully-qualified - # service names as they appear in the protobuf (including the full - # the language_settings.java.interface_names" field in gapic.yaml. API - # teams should otherwise use the service name as it appears in the - # protobuf. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class JavaSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ServiceClassNamesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for C++ client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class CppSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Php client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class PhpSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Python client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] experimental_features - # @return [::Google::Api::PythonSettings::ExperimentalFeatures] - # Experimental features to be included during client library generation. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Experimental features to be included during client library generation. - # These fields will be deprecated once the feature graduates and is enabled - # by default. - # @!attribute [rw] rest_async_io_enabled - # @return [::Boolean] - # Enables generation of asynchronous REST clients if `rest` transport is - # enabled. By default, asynchronous REST clients will not be generated. - # This feature will be enabled by default 1 month after launching the - # feature in preview packages. - # @!attribute [rw] protobuf_pythonic_types_enabled - # @return [::Boolean] - # Enables generation of protobuf code using new types that are more - # Pythonic which are included in `protobuf>=5.29.x`. This feature will be - # enabled by default 1 month after launching the feature in preview - # packages. - # @!attribute [rw] unversioned_package_disabled - # @return [::Boolean] - # Disables generation of an unversioned Python package for this client - # library. This means that the module names will need to be versioned in - # import statements. For example `import google.cloud.library_v2` instead - # of `import google.cloud.library`. - class ExperimentalFeatures - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Node client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class NodeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Dotnet client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from original service names to renamed versions. - # This is used when the default generated types - # would cause a naming conflict. (Neither name is - # fully-qualified.) - # Example: Subscriber to SubscriberServiceApi. - # @!attribute [rw] renamed_resources - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from full resource types to the effective short name - # for the resource. This is used when otherwise resource - # named from different services would cause naming collisions. - # Example entry: - # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - # @!attribute [rw] ignored_resources - # @return [::Array<::String>] - # List of full resource types to ignore during generation. - # This is typically used for API-specific Location resources, - # which should be handled by the generator as if they were actually - # the common Location resources. - # Example entry: "documentai.googleapis.com/Location" - # @!attribute [rw] forced_namespace_aliases - # @return [::Array<::String>] - # Namespaces which must be aliased in snippets due to - # a known (but non-generator-predictable) naming collision - # @!attribute [rw] handwritten_signatures - # @return [::Array<::String>] - # Method signatures (in the form "service.method(signature)") - # which are provided separately, so shouldn't be generated. - # Snippets *calling* these methods are still generated, however. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedResourcesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Ruby client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class RubySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Go client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map of service names to renamed services. Keys are the package relative - # service names and values are the name to be used for the service client - # and call options. - # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Describes the generator configuration for a method. - # @!attribute [rw] selector - # @return [::String] - # The fully qualified name of the method, for which the options below apply. - # This is used to find the method to apply the options. - # - # Example: - # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... - # @!attribute [rw] long_running - # @return [::Google::Api::MethodSettings::LongRunning] - # Describes settings to use for long-running operations when generating - # API methods for RPCs. Complements RPCs that use the annotations in - # google/longrunning/operations.proto. - # - # Example of a YAML configuration:: - # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes - # @!attribute [rw] auto_populated_fields - # @return [::Array<::String>] - # List of top-level fields of the request message, that should be - # automatically populated by the client libraries based on their - # (google.api.field_info).format. Currently supported format: UUID4. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id - class MethodSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes settings to use when generating API methods that use the - # long-running operation pattern. - # All default values below are from those used in the client library - # generators (e.g. - # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). - # @!attribute [rw] initial_poll_delay - # @return [::Google::Protobuf::Duration] - # Initial delay after which the first poll request will be made. - # Default value: 5 seconds. - # @!attribute [rw] poll_delay_multiplier - # @return [::Float] - # Multiplier to gradually increase delay between subsequent polls until it - # reaches max_poll_delay. - # Default value: 1.5. - # @!attribute [rw] max_poll_delay - # @return [::Google::Protobuf::Duration] - # Maximum time between two subsequent poll requests. - # Default value: 45 seconds. - # @!attribute [rw] total_poll_timeout - # @return [::Google::Protobuf::Duration] - # Total polling timeout. - # Default value: 5 minutes. - class LongRunning - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # This message is used to configure the generation of a subset of the RPCs in - # a service for client libraries. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - end -end diff --git a/owl-bot-staging/google-cloud-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 f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-redis-v1beta1/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/rg" - -require "grpc" - -require "ostruct" diff --git a/owl-bot-staging/google-cloud-redis/.gitignore b/owl-bot-staging/google-cloud-redis/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-redis/.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/.repo-metadata.json b/owl-bot-staging/google-cloud-redis/.repo-metadata.json deleted file mode 100644 index dcc38b4fbac7..000000000000 --- a/owl-bot-staging/google-cloud-redis/.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/latest", - "distribution_name": "google-cloud-redis", - "is_cloud": true, - "language": "ruby", - "name": "redis", - "name_pretty": "Google Cloud Memorystore for Redis 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.", - "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/.rubocop.yml b/owl-bot-staging/google-cloud-redis/.rubocop.yml deleted file mode 100644 index 2251f5deb43a..000000000000 --- a/owl-bot-staging/google-cloud-redis/.rubocop.yml +++ /dev/null @@ -1,39 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-redis.gemspec" - - "Rakefile" - - "acceptance/**/*" - - "test/**/*" - -Bundler/OrderedGems: - Enabled: false -Documentation: - Enabled: false -Layout/LineLength: - Enabled: false -Metrics/BlockLength: - Exclude: - - "samples/**/acceptance/*.rb" -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/FileName: - Exclude: - - "lib/google-cloud-redis.rb" - -Style/BlockDelimiters: - Exclude: - - "samples/**/acceptance/*.rb" diff --git a/owl-bot-staging/google-cloud-redis/.toys.rb b/owl-bot-staging/google-cloud-redis/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-redis/.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/.yardopts b/owl-bot-staging/google-cloud-redis/.yardopts deleted file mode 100644 index 99a35e32f21f..000000000000 --- a/owl-bot-staging/google-cloud-redis/.yardopts +++ /dev/null @@ -1,11 +0,0 @@ ---no-private ---title="Google Cloud Memorystore for Redis API" ---exclude _pb\.rb$ ---markup markdown ---markup-provider redcarpet - -./lib/**/*.rb -- -README.md -AUTHENTICATION.md -LICENSE.md diff --git a/owl-bot-staging/google-cloud-redis/AUTHENTICATION.md b/owl-bot-staging/google-cloud-redis/AUTHENTICATION.md deleted file mode 100644 index ea9c72a70bac..000000000000 --- a/owl-bot-staging/google-cloud-redis/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-redis 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 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" - -client = Google::Cloud::Redis.cloud_redis do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/redis" - -Google::Cloud::Redis.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = Google::Cloud::Redis.cloud_redis -``` - -### 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 -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" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = Google::Cloud::Redis.cloud_redis -``` - -### 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/CHANGELOG.md b/owl-bot-staging/google-cloud-redis/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-redis/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-redis/Gemfile b/owl-bot-staging/google-cloud-redis/Gemfile deleted file mode 100644 index ab8a61212319..000000000000 --- a/owl-bot-staging/google-cloud-redis/Gemfile +++ /dev/null @@ -1,28 +0,0 @@ -source "https://rubygems.org" - -gemspec - -local_dependencies = ["google-cloud-redis-v1"] - -main_spec = gemspecs.last || Bundler.load_gemspec(File.join(__dir__, "google-cloud-redis.gemspec")) -local_dependencies.each do |name| - spec_path = File.expand_path "../#{name}/#{name}.gemspec", __dir__ - unless File.file? spec_path - warn "WARNING: Disabled local dependency for #{name} because gemspec not found." - next - end - version = Bundler.load_gemspec(spec_path).version - if main_spec.dependencies.any? { |dep| dep.name == name && !dep.requirement.satisfied_by?(version) } - warn "WARNING: Disabled local dependency for #{name} because the gemspec disallows version #{version}." - next - end - gem name, path: "../#{name}" -end - -gem "google-style", "~> 1.30.1" -gem "minitest", "~> 5.22" -gem "minitest-focus", "~> 1.4" -gem "minitest-rg", "~> 5.3" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-redis/LICENSE.md b/owl-bot-staging/google-cloud-redis/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-redis/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/README.md b/owl-bot-staging/google-cloud-redis/README.md deleted file mode 100644 index 1284375ee42d..000000000000 --- a/owl-bot-staging/google-cloud-redis/README.md +++ /dev/null @@ -1,142 +0,0 @@ -# Ruby Client for the Google Cloud Memorystore for Redis API - -API Client library for the Google Cloud Memorystore for Redis API - -Creates and manages Redis instances on the Google Cloud Platform. - -Actual client classes for the various versions of this API are defined in -_versioned_ client gems, with names of the form `google-cloud-redis-v*`. -The gem `google-cloud-redis` is the main client library that brings the -versioned gems in as dependencies, and provides high-level methods for -constructing clients. More information on versioned clients can be found below -in the section titled *Which client should I use?*. - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-redis/latest) -for this library, google-cloud-redis, to see the convenience methods for -constructing client objects. Reference documentation for the client objects -themselves can be found in the client library documentation for the versioned -client gems: -[google-cloud-redis-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-redis-v1/latest). - -See also the [Product Documentation](https://cloud.google.com/memorystore/docs/redis) -for more usage information. - -## Quick Start - -``` -$ gem install google-cloud-redis -``` - -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) - -```ruby -require "google/cloud/redis" - -client = Google::Cloud::Redis.cloud_redis -request = ::Google::Cloud::Redis::V1::ListInstancesRequest.new # (request fields as keyword arguments...) -response = client.list_instances request -``` - -## 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. - -Debug logging also requires that the versioned clients for this service be -sufficiently recent, released after about Dec 10, 2024. If logging is not -working, try updating the versioned clients in your bundle or installed gems: -[google-cloud-redis-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-redis-v1/latest). - -## 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/Rakefile b/owl-bot-staging/google-cloud-redis/Rakefile deleted file mode 100644 index fab25f21e041..000000000000 --- a/owl-bot-staging/google-cloud-redis/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 = true -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 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 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 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 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 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-redis" - header "google-cloud-redis rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-redis yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-redis 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 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 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/google-cloud-redis.gemspec b/owl-bot-staging/google-cloud-redis/google-cloud-redis.gemspec deleted file mode 100644 index fe31ceb853a2..000000000000 --- a/owl-bot-staging/google-cloud-redis/google-cloud-redis.gemspec +++ /dev/null @@ -1,27 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/redis/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-redis" - gem.version = Google::Cloud::Redis::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Creates and manages Redis instances on the Google Cloud Platform." - gem.summary = "API Client library for the Google Cloud Memorystore for Redis 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") + - ["README.md", "AUTHENTICATION.md", "LICENSE.md", ".yardopts"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 3.0" - - gem.add_dependency "google-cloud-core", "~> 1.6" - gem.add_dependency "google-cloud-redis-v1", "~> 2.0" -end diff --git a/owl-bot-staging/google-cloud-redis/lib/google-cloud-redis.rb b/owl-bot-staging/google-cloud-redis/lib/google-cloud-redis.rb deleted file mode 100644 index 24f7f7efe908..000000000000 --- a/owl-bot-staging/google-cloud-redis/lib/google-cloud-redis.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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" unless defined? Google::Cloud::Redis::VERSION diff --git a/owl-bot-staging/google-cloud-redis/lib/google/cloud/redis.rb b/owl-bot-staging/google-cloud-redis/lib/google/cloud/redis.rb deleted file mode 100644 index 538f1afd0136..000000000000 --- a/owl-bot-staging/google-cloud-redis/lib/google/cloud/redis.rb +++ /dev/null @@ -1,170 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# Require this file early so that the version constant gets defined before -# requiring "google/cloud". This is because google-cloud-core will load the -# entrypoint (gem name) file, which in turn re-requires this file (hence -# causing a require cycle) unless the version constant is already defined. -require "google/cloud/redis/version" - -require "googleauth" -gem "google-cloud-core" -require "google/cloud" unless defined? ::Google::Cloud.new -require "google/cloud/config" - -# Set the default configuration -::Google::Cloud.configure.add_config! :redis do |config| - config.add_field! :endpoint, nil, match: ::String - config.add_field! :credentials, nil, match: [::String, ::Hash, ::Google::Auth::Credentials] - config.add_field! :scope, nil, match: [::Array, ::String] - config.add_field! :lib_name, nil, match: ::String - config.add_field! :lib_version, nil, match: ::String - config.add_field! :interceptors, nil, match: ::Array - config.add_field! :timeout, nil, match: ::Numeric - config.add_field! :metadata, nil, match: ::Hash - config.add_field! :retry_policy, nil, match: [::Hash, ::Proc] - config.add_field! :quota_project, nil, match: ::String - config.add_field! :universe_domain, nil, match: ::String -end - -module Google - module Cloud - module Redis - ## - # Create a new client object for CloudRedis. - # - # By default, this returns an instance of - # [Google::Cloud::Redis::V1::CloudRedis::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-redis-v1/latest/Google-Cloud-Redis-V1-CloudRedis-Client) - # for a gRPC client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the CloudRedis service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the CloudRedis service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Redis.cloud_redis_available?}. - # - # ## About 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` - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.cloud_redis version: :v1, transport: :grpc, &block - require "google/cloud/redis/#{version.to_s.downcase}" - - package_name = Google::Cloud::Redis - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Redis.const_get(package_name).const_get(:CloudRedis) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the CloudRedis service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Redis.cloud_redis}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the CloudRedis service, - # or if the versioned client gem needs an update to support the CloudRedis service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.cloud_redis_available? version: :v1, transport: :grpc - require "google/cloud/redis/#{version.to_s.downcase}" - package_name = Google::Cloud::Redis - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Redis.const_get package_name - return false unless service_module.const_defined? :CloudRedis - service_module = service_module.const_get :CloudRedis - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Configure the google-cloud-redis library. - # - # The following configuration parameters are supported: - # - # * `credentials` (*type:* `String, Hash, Google::Auth::Credentials`) - - # The path to the keyfile as a String, the contents of the keyfile as a - # Hash, or a Google::Auth::Credentials object. - # * `lib_name` (*type:* `String`) - - # The library name as recorded in instrumentation and logging. - # * `lib_version` (*type:* `String`) - - # The library version as recorded in instrumentation and logging. - # * `interceptors` (*type:* `Array`) - - # An array of interceptors that are run before calls are executed. - # * `timeout` (*type:* `Numeric`) - - # Default timeout in seconds. - # * `metadata` (*type:* `Hash{Symbol=>String}`) - - # Additional headers to be sent with the call. - # * `retry_policy` (*type:* `Hash`) - - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - - # The error codes that should trigger a retry. - # - # @return [::Google::Cloud::Config] The default configuration used by this library - # - def self.configure - yield ::Google::Cloud.configure.redis if block_given? - - ::Google::Cloud.configure.redis - end - end - end -end - -helper_path = ::File.join __dir__, "redis", "helpers.rb" -require "google/cloud/redis/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-redis/lib/google/cloud/redis/version.rb b/owl-bot-staging/google-cloud-redis/lib/google/cloud/redis/version.rb deleted file mode 100644 index cd614cdb85fc..000000000000 --- a/owl-bot-staging/google-cloud-redis/lib/google/cloud/redis/version.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! - - -module Google - module Cloud - module Redis - VERSION = "0.0.1" - end - end -end diff --git a/owl-bot-staging/google-cloud-redis/test/google/cloud/redis/client_test.rb b/owl-bot-staging/google-cloud-redis/test/google/cloud/redis/client_test.rb deleted file mode 100644 index 73cd355f4744..000000000000 --- a/owl-bot-staging/google-cloud-redis/test/google/cloud/redis/client_test.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 "helper" -require "google/cloud/redis" -require "gapic/common" -require "gapic/grpc" -require "gapic/rest" - -class Google::Cloud::Redis::ClientConstructionMinitest < 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_cloud_redis_grpc - skip unless Google::Cloud::Redis.cloud_redis_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::Redis.cloud_redis transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::Redis::V1::CloudRedis::Client, client - end - end - - def test_cloud_redis_rest - skip unless Google::Cloud::Redis.cloud_redis_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Redis.cloud_redis transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Redis::V1::CloudRedis::Rest::Client, client - end - end -end diff --git a/owl-bot-staging/google-cloud-redis/test/google/cloud/redis/version_test.rb b/owl-bot-staging/google-cloud-redis/test/google/cloud/redis/version_test.rb deleted file mode 100644 index d762219f9508..000000000000 --- a/owl-bot-staging/google-cloud-redis/test/google/cloud/redis/version_test.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 "helper" -require "google/cloud/redis/version" - -class Google::Cloud::Redis::VersionMinitest < Minitest::Test - def test_has_a_version - refute_nil Google::Cloud::Redis::VERSION - end -end diff --git a/owl-bot-staging/google-cloud-redis/test/helper.rb b/owl-bot-staging/google-cloud-redis/test/helper.rb deleted file mode 100644 index f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-redis/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/rg" - -require "grpc" - -require "ostruct" 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 6442df18fa2f..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/Gemfile +++ /dev/null @@ -1,11 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.31.1" -gem "minitest", "~> 5.22" -gem "minitest-focus", "~> 1.4" -gem "minitest-rg", "~> 5.3" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-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 b8d6ae64be9d..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.1" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" - gem.add_dependency "grpc-google-iam-v1", "~> 1.11" -end diff --git a/owl-bot-staging/google-cloud-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 57454e79f8d4..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/folders_pb.rb +++ /dev/null @@ -1,70 +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 - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module 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 2032cfd00f73..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/organizations_pb.rb +++ /dev/null @@ -1,57 +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 - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module 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 2d27364f0117..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/projects_pb.rb +++ /dev/null @@ -1,70 +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 - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module 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 804f1bf575ec..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_bindings_pb.rb +++ /dev/null @@ -1,58 +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 - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module 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 d4eb3804ad3c..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_holds_pb.rb +++ /dev/null @@ -1,57 +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 - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module 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 ba87d6366407..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_keys_pb.rb +++ /dev/null @@ -1,65 +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 - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module 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 027b74c11421..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/lib/google/cloud/resourcemanager/v3/tag_values_pb.rb +++ /dev/null @@ -1,64 +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 - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module 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 d59ba51a5612..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/proto_docs/google/api/client.rb +++ /dev/null @@ -1,473 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 - # @!attribute [rw] service_class_names - # @return [::Google::Protobuf::Map{::String => ::String}] - # Configure the Java class name to use instead of the service's for its - # corresponding generated GAPIC client. Keys are fully-qualified - # service names as they appear in the protobuf (including the full - # the language_settings.java.interface_names" field in gapic.yaml. API - # teams should otherwise use the service name as it appears in the - # protobuf. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class JavaSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ServiceClassNamesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for C++ client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class CppSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Php client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class PhpSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Python client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] experimental_features - # @return [::Google::Api::PythonSettings::ExperimentalFeatures] - # Experimental features to be included during client library generation. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Experimental features to be included during client library generation. - # These fields will be deprecated once the feature graduates and is enabled - # by default. - # @!attribute [rw] rest_async_io_enabled - # @return [::Boolean] - # Enables generation of asynchronous REST clients if `rest` transport is - # enabled. By default, asynchronous REST clients will not be generated. - # This feature will be enabled by default 1 month after launching the - # feature in preview packages. - # @!attribute [rw] protobuf_pythonic_types_enabled - # @return [::Boolean] - # Enables generation of protobuf code using new types that are more - # Pythonic which are included in `protobuf>=5.29.x`. This feature will be - # enabled by default 1 month after launching the feature in preview - # packages. - # @!attribute [rw] unversioned_package_disabled - # @return [::Boolean] - # Disables generation of an unversioned Python package for this client - # library. This means that the module names will need to be versioned in - # import statements. For example `import google.cloud.library_v2` instead - # of `import google.cloud.library`. - class ExperimentalFeatures - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Node client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class NodeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Dotnet client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from original service names to renamed versions. - # This is used when the default generated types - # would cause a naming conflict. (Neither name is - # fully-qualified.) - # Example: Subscriber to SubscriberServiceApi. - # @!attribute [rw] renamed_resources - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from full resource types to the effective short name - # for the resource. This is used when otherwise resource - # named from different services would cause naming collisions. - # Example entry: - # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - # @!attribute [rw] ignored_resources - # @return [::Array<::String>] - # List of full resource types to ignore during generation. - # This is typically used for API-specific Location resources, - # which should be handled by the generator as if they were actually - # the common Location resources. - # Example entry: "documentai.googleapis.com/Location" - # @!attribute [rw] forced_namespace_aliases - # @return [::Array<::String>] - # Namespaces which must be aliased in snippets due to - # a known (but non-generator-predictable) naming collision - # @!attribute [rw] handwritten_signatures - # @return [::Array<::String>] - # Method signatures (in the form "service.method(signature)") - # which are provided separately, so shouldn't be generated. - # Snippets *calling* these methods are still generated, however. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedResourcesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Ruby client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class RubySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Go client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map of service names to renamed services. Keys are the package relative - # service names and values are the name to be used for the service client - # and call options. - # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Describes the generator configuration for a method. - # @!attribute [rw] selector - # @return [::String] - # The fully qualified name of the method, for which the options below apply. - # This is used to find the method to apply the options. - # - # Example: - # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... - # @!attribute [rw] long_running - # @return [::Google::Api::MethodSettings::LongRunning] - # Describes settings to use for long-running operations when generating - # API methods for RPCs. Complements RPCs that use the annotations in - # google/longrunning/operations.proto. - # - # Example of a YAML configuration:: - # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes - # @!attribute [rw] auto_populated_fields - # @return [::Array<::String>] - # List of top-level fields of the request message, that should be - # automatically populated by the client libraries based on their - # (google.api.field_info).format. Currently supported format: UUID4. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id - class MethodSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes settings to use when generating API methods that use the - # long-running operation pattern. - # All default values below are from those used in the client library - # generators (e.g. - # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). - # @!attribute [rw] initial_poll_delay - # @return [::Google::Protobuf::Duration] - # Initial delay after which the first poll request will be made. - # Default value: 5 seconds. - # @!attribute [rw] poll_delay_multiplier - # @return [::Float] - # Multiplier to gradually increase delay between subsequent polls until it - # reaches max_poll_delay. - # Default value: 1.5. - # @!attribute [rw] max_poll_delay - # @return [::Google::Protobuf::Duration] - # Maximum time between two subsequent poll requests. - # Default value: 45 seconds. - # @!attribute [rw] total_poll_timeout - # @return [::Google::Protobuf::Duration] - # Total polling timeout. - # Default value: 5 minutes. - class LongRunning - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # This message is used to configure the generation of a subset of the RPCs in - # a service for client libraries. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - end -end diff --git a/owl-bot-staging/google-cloud-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 f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager-v3/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/rg" - -require "grpc" - -require "ostruct" diff --git a/owl-bot-staging/google-cloud-resource_manager/.gitignore b/owl-bot-staging/google-cloud-resource_manager/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager/.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/.repo-metadata.json b/owl-bot-staging/google-cloud-resource_manager/.repo-metadata.json deleted file mode 100644 index 8a72b65aaf7b..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager/.repo-metadata.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "api_id": "cloudresourcemanager.googleapis.com", - "api_shortname": "cloudresourcemanager", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-resource_manager/latest", - "distribution_name": "google-cloud-resource_manager", - "is_cloud": true, - "language": "ruby", - "name": "cloudresourcemanager", - "name_pretty": "Cloud Resource Manager API", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Creates, reads, and updates metadata for Google Cloud Platform resource containers.", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-resource_manager/.rubocop.yml b/owl-bot-staging/google-cloud-resource_manager/.rubocop.yml deleted file mode 100644 index 38e7ef0201f0..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager/.rubocop.yml +++ /dev/null @@ -1,39 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-resource_manager.gemspec" - - "Rakefile" - - "acceptance/**/*" - - "test/**/*" - -Bundler/OrderedGems: - Enabled: false -Documentation: - Enabled: false -Layout/LineLength: - Enabled: false -Metrics/BlockLength: - Exclude: - - "samples/**/acceptance/*.rb" -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/FileName: - Exclude: - - "lib/google-cloud-resource_manager.rb" - -Style/BlockDelimiters: - Exclude: - - "samples/**/acceptance/*.rb" diff --git a/owl-bot-staging/google-cloud-resource_manager/.toys.rb b/owl-bot-staging/google-cloud-resource_manager/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager/.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/.yardopts b/owl-bot-staging/google-cloud-resource_manager/.yardopts deleted file mode 100644 index f33dd0accdd3..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Cloud Resource Manager API" ---exclude _pb\.rb$ ---markup markdown ---markup-provider redcarpet - -./lib/**/*.rb -- -README.md -AUTHENTICATION.md -MIGRATING.md -LICENSE.md diff --git a/owl-bot-staging/google-cloud-resource_manager/AUTHENTICATION.md b/owl-bot-staging/google-cloud-resource_manager/AUTHENTICATION.md deleted file mode 100644 index a0127ab5179c..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-resource_manager 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 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" - -client = Google::Cloud::ResourceManager.folders do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/resource_manager" - -Google::Cloud::ResourceManager.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = Google::Cloud::ResourceManager.folders -``` - -### 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 -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" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = Google::Cloud::ResourceManager.folders -``` - -### 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/CHANGELOG.md b/owl-bot-staging/google-cloud-resource_manager/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-resource_manager/Gemfile b/owl-bot-staging/google-cloud-resource_manager/Gemfile deleted file mode 100644 index bd424fdd9c48..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager/Gemfile +++ /dev/null @@ -1,28 +0,0 @@ -source "https://rubygems.org" - -gemspec - -local_dependencies = ["google-cloud-resource_manager-v3"] - -main_spec = gemspecs.last || Bundler.load_gemspec(File.join(__dir__, "google-cloud-resource_manager.gemspec")) -local_dependencies.each do |name| - spec_path = File.expand_path "../#{name}/#{name}.gemspec", __dir__ - unless File.file? spec_path - warn "WARNING: Disabled local dependency for #{name} because gemspec not found." - next - end - version = Bundler.load_gemspec(spec_path).version - if main_spec.dependencies.any? { |dep| dep.name == name && !dep.requirement.satisfied_by?(version) } - warn "WARNING: Disabled local dependency for #{name} because the gemspec disallows version #{version}." - next - end - gem name, path: "../#{name}" -end - -gem "google-style", "~> 1.30.1" -gem "minitest", "~> 5.22" -gem "minitest-focus", "~> 1.4" -gem "minitest-rg", "~> 5.3" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-resource_manager/LICENSE.md b/owl-bot-staging/google-cloud-resource_manager/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager/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/README.md b/owl-bot-staging/google-cloud-resource_manager/README.md deleted file mode 100644 index 7fb718e3aac5..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager/README.md +++ /dev/null @@ -1,147 +0,0 @@ -# Ruby Client for the Cloud Resource Manager API - -Creates, reads, and updates metadata for Google Cloud Platform resource containers. - -Creates, reads, and updates metadata for Google Cloud Platform resource containers. - -Actual client classes for the various versions of this API are defined in -_versioned_ client gems, with names of the form `google-cloud-resource_manager-v*`. -The gem `google-cloud-resource_manager` is the main client library that brings the -versioned gems in as dependencies, and provides high-level methods for -constructing clients. More information on versioned clients can be found below -in the section titled *Which client should I use?*. - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-resource_manager/latest) -for this library, google-cloud-resource_manager, to see the convenience methods for -constructing client objects. Reference documentation for the client objects -themselves can be found in the client library documentation for the versioned -client gems: -[google-cloud-resource_manager-v3](https://cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest). - -## Quick Start - -``` -$ gem install google-cloud-resource_manager -``` - -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) - -```ruby -require "google/cloud/resource_manager" - -client = Google::Cloud::ResourceManager.folders -request = ::Google::Cloud::ResourceManager::V3::GetFolderRequest.new # (request fields as keyword arguments...) -response = client.get_folder request -``` - -## Migrating from 0.x versions - -The 1.0 release of the google-cloud-resource_manager client is a significant upgrade -based on a [next-gen code generator](https://github.com/googleapis/gapic-generator-ruby), -and includes substantial interface changes. Existing code written for earlier -versions of this library will likely require updates to use this version. -See the {file:MIGRATING.md MIGRATING.md} document for more 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. - -Debug logging also requires that the versioned clients for this service be -sufficiently recent, released after about Dec 10, 2024. If logging is not -working, try updating the versioned clients in your bundle or installed gems: -[google-cloud-resource_manager-v3](https://cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest). - -## 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/Rakefile b/owl-bot-staging/google-cloud-resource_manager/Rakefile deleted file mode 100644 index 46ca31bfc501..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager/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 = true -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 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/resource_manager/v3/folders/credentials" - ::Google::Cloud::ResourceManager::V3::Folders::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-resource_manager 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 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 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 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-resource_manager" - header "google-cloud-resource_manager rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-resource_manager yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-resource_manager 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 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 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/google-cloud-resource_manager.gemspec b/owl-bot-staging/google-cloud-resource_manager/google-cloud-resource_manager.gemspec deleted file mode 100644 index c4e13b52f47f..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager/google-cloud-resource_manager.gemspec +++ /dev/null @@ -1,27 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/resource_manager/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-resource_manager" - gem.version = Google::Cloud::ResourceManager::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Creates, reads, and updates metadata for Google Cloud Platform resource containers." - 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") + - ["README.md", "AUTHENTICATION.md", "LICENSE.md", ".yardopts", "MIGRATING.md"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 3.0" - - gem.add_dependency "google-cloud-core", "~> 1.6" - gem.add_dependency "google-cloud-resource_manager-v3", "~> 1.2" -end diff --git a/owl-bot-staging/google-cloud-resource_manager/lib/google-cloud-resource_manager.rb b/owl-bot-staging/google-cloud-resource_manager/lib/google-cloud-resource_manager.rb deleted file mode 100644 index a17c3b857361..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager/lib/google-cloud-resource_manager.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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" unless defined? Google::Cloud::ResourceManager::VERSION diff --git a/owl-bot-staging/google-cloud-resource_manager/lib/google/cloud/resource_manager.rb b/owl-bot-staging/google-cloud-resource_manager/lib/google/cloud/resource_manager.rb deleted file mode 100644 index 763710153ab8..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager/lib/google/cloud/resource_manager.rb +++ /dev/null @@ -1,583 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# Require this file early so that the version constant gets defined before -# requiring "google/cloud". This is because google-cloud-core will load the -# entrypoint (gem name) file, which in turn re-requires this file (hence -# causing a require cycle) unless the version constant is already defined. -require "google/cloud/resource_manager/version" - -require "googleauth" -gem "google-cloud-core" -require "google/cloud" unless defined? ::Google::Cloud.new -require "google/cloud/config" - -# Set the default configuration -::Google::Cloud.configure.add_config! :resource_manager do |config| - config.add_field! :endpoint, nil, match: ::String - config.add_field! :credentials, nil, match: [::String, ::Hash, ::Google::Auth::Credentials] - config.add_field! :scope, nil, match: [::Array, ::String] - config.add_field! :lib_name, nil, match: ::String - config.add_field! :lib_version, nil, match: ::String - config.add_field! :interceptors, nil, match: ::Array - config.add_field! :timeout, nil, match: ::Numeric - config.add_field! :metadata, nil, match: ::Hash - config.add_field! :retry_policy, nil, match: [::Hash, ::Proc] - config.add_field! :quota_project, nil, match: ::String - config.add_field! :universe_domain, nil, match: ::String -end - -module Google - module Cloud - module ResourceManager - ## - # Create a new client object for Folders. - # - # By default, this returns an instance of - # [Google::Cloud::ResourceManager::V3::Folders::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Cloud-ResourceManager-V3-Folders-Client) - # for a gRPC client for version V3 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the Folders service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the Folders service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::ResourceManager.folders_available?}. - # - # ## About 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. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v3`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.folders version: :v3, transport: :grpc, &block - require "google/cloud/resource_manager/#{version.to_s.downcase}" - - package_name = Google::Cloud::ResourceManager - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::ResourceManager.const_get(package_name).const_get(:Folders) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the Folders service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::ResourceManager.folders}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the Folders service, - # or if the versioned client gem needs an update to support the Folders service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v3`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.folders_available? version: :v3, transport: :grpc - require "google/cloud/resource_manager/#{version.to_s.downcase}" - package_name = Google::Cloud::ResourceManager - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::ResourceManager.const_get package_name - return false unless service_module.const_defined? :Folders - service_module = service_module.const_get :Folders - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for Organizations. - # - # By default, this returns an instance of - # [Google::Cloud::ResourceManager::V3::Organizations::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Cloud-ResourceManager-V3-Organizations-Client) - # for a gRPC client for version V3 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the Organizations service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the Organizations service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::ResourceManager.organizations_available?}. - # - # ## About Organizations - # - # Allows users to manage their organization resources. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v3`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.organizations version: :v3, transport: :grpc, &block - require "google/cloud/resource_manager/#{version.to_s.downcase}" - - package_name = Google::Cloud::ResourceManager - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::ResourceManager.const_get(package_name).const_get(:Organizations) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the Organizations service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::ResourceManager.organizations}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the Organizations service, - # or if the versioned client gem needs an update to support the Organizations service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v3`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.organizations_available? version: :v3, transport: :grpc - require "google/cloud/resource_manager/#{version.to_s.downcase}" - package_name = Google::Cloud::ResourceManager - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::ResourceManager.const_get package_name - return false unless service_module.const_defined? :Organizations - service_module = service_module.const_get :Organizations - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for Projects. - # - # By default, this returns an instance of - # [Google::Cloud::ResourceManager::V3::Projects::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Cloud-ResourceManager-V3-Projects-Client) - # for a gRPC client for version V3 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the Projects service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the Projects service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::ResourceManager.projects_available?}. - # - # ## About Projects - # - # Manages Google Cloud Projects. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v3`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.projects version: :v3, transport: :grpc, &block - require "google/cloud/resource_manager/#{version.to_s.downcase}" - - package_name = Google::Cloud::ResourceManager - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::ResourceManager.const_get(package_name).const_get(:Projects) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the Projects service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::ResourceManager.projects}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the Projects service, - # or if the versioned client gem needs an update to support the Projects service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v3`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.projects_available? version: :v3, transport: :grpc - require "google/cloud/resource_manager/#{version.to_s.downcase}" - package_name = Google::Cloud::ResourceManager - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::ResourceManager.const_get package_name - return false unless service_module.const_defined? :Projects - service_module = service_module.const_get :Projects - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for TagBindings. - # - # By default, this returns an instance of - # [Google::Cloud::ResourceManager::V3::TagBindings::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Cloud-ResourceManager-V3-TagBindings-Client) - # for a gRPC client for version V3 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the TagBindings service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the TagBindings service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::ResourceManager.tag_bindings_available?}. - # - # ## About TagBindings - # - # Allow users to create and manage TagBindings between TagValues and - # different Google Cloud resources throughout the GCP resource hierarchy. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v3`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.tag_bindings version: :v3, transport: :grpc, &block - require "google/cloud/resource_manager/#{version.to_s.downcase}" - - package_name = Google::Cloud::ResourceManager - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::ResourceManager.const_get(package_name).const_get(:TagBindings) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the TagBindings service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::ResourceManager.tag_bindings}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the TagBindings service, - # or if the versioned client gem needs an update to support the TagBindings service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v3`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.tag_bindings_available? version: :v3, transport: :grpc - require "google/cloud/resource_manager/#{version.to_s.downcase}" - package_name = Google::Cloud::ResourceManager - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::ResourceManager.const_get package_name - return false unless service_module.const_defined? :TagBindings - service_module = service_module.const_get :TagBindings - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for TagHolds. - # - # By default, this returns an instance of - # [Google::Cloud::ResourceManager::V3::TagHolds::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Cloud-ResourceManager-V3-TagHolds-Client) - # for a gRPC client for version V3 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the TagHolds service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the TagHolds service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::ResourceManager.tag_holds_available?}. - # - # ## About 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. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v3`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.tag_holds version: :v3, transport: :grpc, &block - require "google/cloud/resource_manager/#{version.to_s.downcase}" - - package_name = Google::Cloud::ResourceManager - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::ResourceManager.const_get(package_name).const_get(:TagHolds) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the TagHolds service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::ResourceManager.tag_holds}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the TagHolds service, - # or if the versioned client gem needs an update to support the TagHolds service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v3`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.tag_holds_available? version: :v3, transport: :grpc - require "google/cloud/resource_manager/#{version.to_s.downcase}" - package_name = Google::Cloud::ResourceManager - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::ResourceManager.const_get package_name - return false unless service_module.const_defined? :TagHolds - service_module = service_module.const_get :TagHolds - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for TagKeys. - # - # By default, this returns an instance of - # [Google::Cloud::ResourceManager::V3::TagKeys::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Cloud-ResourceManager-V3-TagKeys-Client) - # for a gRPC client for version V3 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the TagKeys service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the TagKeys service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::ResourceManager.tag_keys_available?}. - # - # ## About TagKeys - # - # Allow users to create and manage tag keys. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v3`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.tag_keys version: :v3, transport: :grpc, &block - require "google/cloud/resource_manager/#{version.to_s.downcase}" - - package_name = Google::Cloud::ResourceManager - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::ResourceManager.const_get(package_name).const_get(:TagKeys) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the TagKeys service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::ResourceManager.tag_keys}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the TagKeys service, - # or if the versioned client gem needs an update to support the TagKeys service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v3`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.tag_keys_available? version: :v3, transport: :grpc - require "google/cloud/resource_manager/#{version.to_s.downcase}" - package_name = Google::Cloud::ResourceManager - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::ResourceManager.const_get package_name - return false unless service_module.const_defined? :TagKeys - service_module = service_module.const_get :TagKeys - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for TagValues. - # - # By default, this returns an instance of - # [Google::Cloud::ResourceManager::V3::TagValues::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Cloud-ResourceManager-V3-TagValues-Client) - # for a gRPC client for version V3 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the TagValues service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the TagValues service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::ResourceManager.tag_values_available?}. - # - # ## About TagValues - # - # Allow users to create and manage tag values. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v3`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.tag_values version: :v3, transport: :grpc, &block - require "google/cloud/resource_manager/#{version.to_s.downcase}" - - package_name = Google::Cloud::ResourceManager - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::ResourceManager.const_get(package_name).const_get(:TagValues) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the TagValues service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::ResourceManager.tag_values}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the TagValues service, - # or if the versioned client gem needs an update to support the TagValues service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v3`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.tag_values_available? version: :v3, transport: :grpc - require "google/cloud/resource_manager/#{version.to_s.downcase}" - package_name = Google::Cloud::ResourceManager - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::ResourceManager.const_get package_name - return false unless service_module.const_defined? :TagValues - service_module = service_module.const_get :TagValues - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Configure the google-cloud-resource_manager library. - # - # The following configuration parameters are supported: - # - # * `credentials` (*type:* `String, Hash, Google::Auth::Credentials`) - - # The path to the keyfile as a String, the contents of the keyfile as a - # Hash, or a Google::Auth::Credentials object. - # * `lib_name` (*type:* `String`) - - # The library name as recorded in instrumentation and logging. - # * `lib_version` (*type:* `String`) - - # The library version as recorded in instrumentation and logging. - # * `interceptors` (*type:* `Array`) - - # An array of interceptors that are run before calls are executed. - # * `timeout` (*type:* `Numeric`) - - # Default timeout in seconds. - # * `metadata` (*type:* `Hash{Symbol=>String}`) - - # Additional headers to be sent with the call. - # * `retry_policy` (*type:* `Hash`) - - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - - # The error codes that should trigger a retry. - # - # @return [::Google::Cloud::Config] The default configuration used by this library - # - def self.configure - yield ::Google::Cloud.configure.resource_manager if block_given? - - ::Google::Cloud.configure.resource_manager - end - end - end -end - -helper_path = ::File.join __dir__, "resource_manager", "helpers.rb" -require "google/cloud/resource_manager/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-resource_manager/lib/google/cloud/resource_manager/version.rb b/owl-bot-staging/google-cloud-resource_manager/lib/google/cloud/resource_manager/version.rb deleted file mode 100644 index cc2ec91f9504..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager/lib/google/cloud/resource_manager/version.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! - - -module Google - module Cloud - module ResourceManager - VERSION = "0.0.1" - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager/test/google/cloud/resource_manager/client_test.rb b/owl-bot-staging/google-cloud-resource_manager/test/google/cloud/resource_manager/client_test.rb deleted file mode 100644 index 76d471122b3a..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager/test/google/cloud/resource_manager/client_test.rb +++ /dev/null @@ -1,190 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "google/cloud/resource_manager" -require "gapic/common" -require "gapic/grpc" -require "gapic/rest" - -class Google::Cloud::ResourceManager::ClientConstructionMinitest < 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_folders_grpc - skip unless Google::Cloud::ResourceManager.folders_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::ResourceManager.folders transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::ResourceManager::V3::Folders::Client, client - end - end - - def test_folders_rest - skip unless Google::Cloud::ResourceManager.folders_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::ResourceManager.folders transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::ResourceManager::V3::Folders::Rest::Client, client - end - end - - def test_organizations_grpc - skip unless Google::Cloud::ResourceManager.organizations_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::ResourceManager.organizations transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::ResourceManager::V3::Organizations::Client, client - end - end - - def test_organizations_rest - skip unless Google::Cloud::ResourceManager.organizations_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::ResourceManager.organizations transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::ResourceManager::V3::Organizations::Rest::Client, client - end - end - - def test_projects_grpc - skip unless Google::Cloud::ResourceManager.projects_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::ResourceManager.projects transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::ResourceManager::V3::Projects::Client, client - end - end - - def test_projects_rest - skip unless Google::Cloud::ResourceManager.projects_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::ResourceManager.projects transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::ResourceManager::V3::Projects::Rest::Client, client - end - end - - def test_tag_bindings_grpc - skip unless Google::Cloud::ResourceManager.tag_bindings_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::ResourceManager.tag_bindings transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::ResourceManager::V3::TagBindings::Client, client - end - end - - def test_tag_bindings_rest - skip unless Google::Cloud::ResourceManager.tag_bindings_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::ResourceManager.tag_bindings transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::ResourceManager::V3::TagBindings::Rest::Client, client - end - end - - def test_tag_holds_grpc - skip unless Google::Cloud::ResourceManager.tag_holds_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::ResourceManager.tag_holds transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::ResourceManager::V3::TagHolds::Client, client - end - end - - def test_tag_holds_rest - skip unless Google::Cloud::ResourceManager.tag_holds_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::ResourceManager.tag_holds transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::ResourceManager::V3::TagHolds::Rest::Client, client - end - end - - def test_tag_keys_grpc - skip unless Google::Cloud::ResourceManager.tag_keys_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::ResourceManager.tag_keys transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::ResourceManager::V3::TagKeys::Client, client - end - end - - def test_tag_keys_rest - skip unless Google::Cloud::ResourceManager.tag_keys_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::ResourceManager.tag_keys transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::ResourceManager::V3::TagKeys::Rest::Client, client - end - end - - def test_tag_values_grpc - skip unless Google::Cloud::ResourceManager.tag_values_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::ResourceManager.tag_values transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::ResourceManager::V3::TagValues::Client, client - end - end - - def test_tag_values_rest - skip unless Google::Cloud::ResourceManager.tag_values_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::ResourceManager.tag_values transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::ResourceManager::V3::TagValues::Rest::Client, client - end - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager/test/google/cloud/resource_manager/version_test.rb b/owl-bot-staging/google-cloud-resource_manager/test/google/cloud/resource_manager/version_test.rb deleted file mode 100644 index 23c8cdbe40ca..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager/test/google/cloud/resource_manager/version_test.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 "helper" -require "google/cloud/resource_manager/version" - -class Google::Cloud::ResourceManager::VersionMinitest < Minitest::Test - def test_has_a_version - refute_nil Google::Cloud::ResourceManager::VERSION - end -end diff --git a/owl-bot-staging/google-cloud-resource_manager/test/helper.rb b/owl-bot-staging/google-cloud-resource_manager/test/helper.rb deleted file mode 100644 index f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-resource_manager/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/rg" - -require "grpc" - -require "ostruct" 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 6442df18fa2f..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/Gemfile +++ /dev/null @@ -1,11 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.31.1" -gem "minitest", "~> 5.22" -gem "minitest-focus", "~> 1.4" -gem "minitest-rg", "~> 5.3" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-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 602bd7251faf..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.1" - - 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 09c6e9129bf1..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/analytics_service_pb.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/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 - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module 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 143124a08f0b..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_pb.rb +++ /dev/null @@ -1,66 +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 - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.cloud.retail.v2.Interval", "google/cloud/retail/v2/common.proto"], - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.cloud.retail.v2.CompletionDataInputConfig", "google/cloud/retail/v2/import_config.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module 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 15a326b8a013..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/catalog_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/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 - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.cloud.retail.v2.Catalog", "google/cloud/retail/v2/catalog.proto"], - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module 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 abb3ef319229..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/common_pb.rb +++ /dev/null @@ -1,80 +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 - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module 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 6bf97105b323..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/completion_service_pb.rb +++ /dev/null @@ -1,55 +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 - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.cloud.retail.v2.CustomAttribute", "google/cloud/retail/v2/common.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module 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 5a6d76c31509..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_pb.rb +++ /dev/null @@ -1,47 +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 - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.cloud.retail.v2.Rule", "google/cloud/retail/v2/common.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module 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 6e0e44e8fb45..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/control_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/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 - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.cloud.retail.v2.Control", "google/cloud/retail/v2/control.proto"], - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module 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 41c473ddbc80..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/conversational_search_service_pb.rb +++ /dev/null @@ -1,65 +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 - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.cloud.retail.v2.UserInfo", "google/cloud/retail/v2/common.proto"], - ["google.cloud.retail.v2.SafetySetting", "google/cloud/retail/v2/safety.proto"], - ["google.cloud.retail.v2.SearchRequest.BoostSpec", "google/cloud/retail/v2/search_service.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module 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 7d3a69e64319..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/export_config_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/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 - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.rpc.Status", "google/rpc/status.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module 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 53a9e3a0d3a8..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_pb.rb +++ /dev/null @@ -1,45 +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 - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module 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 104d4e7fba36..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/generative_question_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/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 - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.cloud.retail.v2.GenerativeQuestionsFeatureConfig", "google/cloud/retail/v2/generative_question.proto"], - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module 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 d6b726bbbf59..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/import_config_pb.rb +++ /dev/null @@ -1,73 +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 - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.type.Date", "google/type/date.proto"], - ["google.cloud.retail.v2.Product", "google/cloud/retail/v2/product.proto"], - ["google.cloud.retail.v2.UserEvent", "google/cloud/retail/v2/user_event.proto"], - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.rpc.Status", "google/rpc/status.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module 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 02e51a0dafa7..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_pb.rb +++ /dev/null @@ -1,56 +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 - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module 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 d3352f587ea6..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/model_service_pb.rb +++ /dev/null @@ -1,64 +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 f2c254e3ab5a..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/prediction_service_pb.rb +++ /dev/null @@ -1,53 +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 - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.cloud.retail.v2.UserEvent", "google/cloud/retail/v2/user_event.proto"], - ["google.protobuf.Value", "google/protobuf/struct.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module 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 c56b602cfb68..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_pb.rb +++ /dev/null @@ -1,59 +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 - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.protobuf.Duration", "google/protobuf/duration.proto"], - ["google.cloud.retail.v2.PriceInfo", "google/cloud/retail/v2/common.proto"], - ["google.protobuf.Int32Value", "google/protobuf/wrappers.proto"], - ["google.cloud.retail.v2.Promotion", "google/cloud/retail/v2/promotion.proto"], - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module 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 9893d96639fa..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/product_service_pb.rb +++ /dev/null @@ -1,79 +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 - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.cloud.retail.v2.Product", "google/cloud/retail/v2/product.proto"], - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.cloud.retail.v2.LocalInventory", "google/cloud/retail/v2/common.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module 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 4e31e296de19..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/promotion_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/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 - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module 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 e141395dee6a..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/purge_config_pb.rb +++ /dev/null @@ -1,52 +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 - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module 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 f4a296baa3c5..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/safety_pb.rb +++ /dev/null @@ -1,47 +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 - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module 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 4ff8ca5ba66d..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/search_service_pb.rb +++ /dev/null @@ -1,86 +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 - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.cloud.retail.v2.Interval", "google/cloud/retail/v2/common.proto"], - ["google.cloud.retail.v2.Product", "google/cloud/retail/v2/product.proto"], - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ["google.protobuf.Value", "google/protobuf/struct.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module 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 57b5608c7710..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_pb.rb +++ /dev/null @@ -1,49 +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 - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.cloud.retail.v2.SearchRequest.DynamicFacetSpec", "google/cloud/retail/v2/search_service.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module 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 90c9627de012..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/serving_config_service_pb.rb +++ /dev/null @@ -1,59 +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 - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.cloud.retail.v2.ServingConfig", "google/cloud/retail/v2/serving_config.proto"], - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module 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 5c8773051ad8..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_pb.rb +++ /dev/null @@ -1,55 +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 - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.cloud.retail.v2.UserInfo", "google/cloud/retail/v2/common.proto"], - ["google.cloud.retail.v2.Product", "google/cloud/retail/v2/product.proto"], - ["google.protobuf.Int32Value", "google/protobuf/wrappers.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module 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 684f9413331a..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/lib/google/cloud/retail/v2/user_event_service_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/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 - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.cloud.retail.v2.UserEvent", "google/cloud/retail/v2/user_event.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module 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 d59ba51a5612..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/api/client.rb +++ /dev/null @@ -1,473 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 - # @!attribute [rw] service_class_names - # @return [::Google::Protobuf::Map{::String => ::String}] - # Configure the Java class name to use instead of the service's for its - # corresponding generated GAPIC client. Keys are fully-qualified - # service names as they appear in the protobuf (including the full - # the language_settings.java.interface_names" field in gapic.yaml. API - # teams should otherwise use the service name as it appears in the - # protobuf. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class JavaSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ServiceClassNamesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for C++ client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class CppSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Php client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class PhpSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Python client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] experimental_features - # @return [::Google::Api::PythonSettings::ExperimentalFeatures] - # Experimental features to be included during client library generation. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Experimental features to be included during client library generation. - # These fields will be deprecated once the feature graduates and is enabled - # by default. - # @!attribute [rw] rest_async_io_enabled - # @return [::Boolean] - # Enables generation of asynchronous REST clients if `rest` transport is - # enabled. By default, asynchronous REST clients will not be generated. - # This feature will be enabled by default 1 month after launching the - # feature in preview packages. - # @!attribute [rw] protobuf_pythonic_types_enabled - # @return [::Boolean] - # Enables generation of protobuf code using new types that are more - # Pythonic which are included in `protobuf>=5.29.x`. This feature will be - # enabled by default 1 month after launching the feature in preview - # packages. - # @!attribute [rw] unversioned_package_disabled - # @return [::Boolean] - # Disables generation of an unversioned Python package for this client - # library. This means that the module names will need to be versioned in - # import statements. For example `import google.cloud.library_v2` instead - # of `import google.cloud.library`. - class ExperimentalFeatures - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Node client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class NodeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Dotnet client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from original service names to renamed versions. - # This is used when the default generated types - # would cause a naming conflict. (Neither name is - # fully-qualified.) - # Example: Subscriber to SubscriberServiceApi. - # @!attribute [rw] renamed_resources - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from full resource types to the effective short name - # for the resource. This is used when otherwise resource - # named from different services would cause naming collisions. - # Example entry: - # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - # @!attribute [rw] ignored_resources - # @return [::Array<::String>] - # List of full resource types to ignore during generation. - # This is typically used for API-specific Location resources, - # which should be handled by the generator as if they were actually - # the common Location resources. - # Example entry: "documentai.googleapis.com/Location" - # @!attribute [rw] forced_namespace_aliases - # @return [::Array<::String>] - # Namespaces which must be aliased in snippets due to - # a known (but non-generator-predictable) naming collision - # @!attribute [rw] handwritten_signatures - # @return [::Array<::String>] - # Method signatures (in the form "service.method(signature)") - # which are provided separately, so shouldn't be generated. - # Snippets *calling* these methods are still generated, however. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedResourcesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Ruby client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class RubySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Go client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map of service names to renamed services. Keys are the package relative - # service names and values are the name to be used for the service client - # and call options. - # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Describes the generator configuration for a method. - # @!attribute [rw] selector - # @return [::String] - # The fully qualified name of the method, for which the options below apply. - # This is used to find the method to apply the options. - # - # Example: - # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... - # @!attribute [rw] long_running - # @return [::Google::Api::MethodSettings::LongRunning] - # Describes settings to use for long-running operations when generating - # API methods for RPCs. Complements RPCs that use the annotations in - # google/longrunning/operations.proto. - # - # Example of a YAML configuration:: - # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes - # @!attribute [rw] auto_populated_fields - # @return [::Array<::String>] - # List of top-level fields of the request message, that should be - # automatically populated by the client libraries based on their - # (google.api.field_info).format. Currently supported format: UUID4. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id - class MethodSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes settings to use when generating API methods that use the - # long-running operation pattern. - # All default values below are from those used in the client library - # generators (e.g. - # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). - # @!attribute [rw] initial_poll_delay - # @return [::Google::Protobuf::Duration] - # Initial delay after which the first poll request will be made. - # Default value: 5 seconds. - # @!attribute [rw] poll_delay_multiplier - # @return [::Float] - # Multiplier to gradually increase delay between subsequent polls until it - # reaches max_poll_delay. - # Default value: 1.5. - # @!attribute [rw] max_poll_delay - # @return [::Google::Protobuf::Duration] - # Maximum time between two subsequent poll requests. - # Default value: 45 seconds. - # @!attribute [rw] total_poll_timeout - # @return [::Google::Protobuf::Duration] - # Total polling timeout. - # Default value: 5 minutes. - class LongRunning - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # This message is used to configure the generation of a subset of the RPCs in - # a service for client libraries. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - end -end diff --git a/owl-bot-staging/google-cloud-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 1b485b0c3456..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/proto_docs/google/protobuf/wrappers.rb +++ /dev/null @@ -1,121 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # Wrapper message for `double`. - # - # The JSON representation for `DoubleValue` is JSON number. - # @!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. - # @!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. - # @!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. - # @!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. - # @!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. - # @!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`. - # @!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. - # @!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. - # @!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 f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-retail-v2/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/rg" - -require "grpc" - -require "ostruct" diff --git a/owl-bot-staging/google-cloud-retail/.gitignore b/owl-bot-staging/google-cloud-retail/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-retail/.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/.repo-metadata.json b/owl-bot-staging/google-cloud-retail/.repo-metadata.json deleted file mode 100644 index 0bc7656977aa..000000000000 --- a/owl-bot-staging/google-cloud-retail/.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/latest", - "distribution_name": "google-cloud-retail", - "is_cloud": true, - "language": "ruby", - "name": "retail", - "name_pretty": "Retail 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.", - "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/.rubocop.yml b/owl-bot-staging/google-cloud-retail/.rubocop.yml deleted file mode 100644 index bc5a32420f48..000000000000 --- a/owl-bot-staging/google-cloud-retail/.rubocop.yml +++ /dev/null @@ -1,39 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-retail.gemspec" - - "Rakefile" - - "acceptance/**/*" - - "test/**/*" - -Bundler/OrderedGems: - Enabled: false -Documentation: - Enabled: false -Layout/LineLength: - Enabled: false -Metrics/BlockLength: - Exclude: - - "samples/**/acceptance/*.rb" -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/FileName: - Exclude: - - "lib/google-cloud-retail.rb" - -Style/BlockDelimiters: - Exclude: - - "samples/**/acceptance/*.rb" diff --git a/owl-bot-staging/google-cloud-retail/.toys.rb b/owl-bot-staging/google-cloud-retail/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-retail/.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/.yardopts b/owl-bot-staging/google-cloud-retail/.yardopts deleted file mode 100644 index b19814d452b7..000000000000 --- a/owl-bot-staging/google-cloud-retail/.yardopts +++ /dev/null @@ -1,11 +0,0 @@ ---no-private ---title="Retail API" ---exclude _pb\.rb$ ---markup markdown ---markup-provider redcarpet - -./lib/**/*.rb -- -README.md -AUTHENTICATION.md -LICENSE.md diff --git a/owl-bot-staging/google-cloud-retail/AUTHENTICATION.md b/owl-bot-staging/google-cloud-retail/AUTHENTICATION.md deleted file mode 100644 index ad65e919dc19..000000000000 --- a/owl-bot-staging/google-cloud-retail/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-retail 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 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" - -client = Google::Cloud::Retail.analytics_service do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/retail" - -Google::Cloud::Retail.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = Google::Cloud::Retail.analytics_service -``` - -### 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 -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" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = Google::Cloud::Retail.analytics_service -``` - -### 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/CHANGELOG.md b/owl-bot-staging/google-cloud-retail/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-retail/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-retail/Gemfile b/owl-bot-staging/google-cloud-retail/Gemfile deleted file mode 100644 index 9b0b2f3ff744..000000000000 --- a/owl-bot-staging/google-cloud-retail/Gemfile +++ /dev/null @@ -1,28 +0,0 @@ -source "https://rubygems.org" - -gemspec - -local_dependencies = ["google-cloud-retail-v2"] - -main_spec = gemspecs.last || Bundler.load_gemspec(File.join(__dir__, "google-cloud-retail.gemspec")) -local_dependencies.each do |name| - spec_path = File.expand_path "../#{name}/#{name}.gemspec", __dir__ - unless File.file? spec_path - warn "WARNING: Disabled local dependency for #{name} because gemspec not found." - next - end - version = Bundler.load_gemspec(spec_path).version - if main_spec.dependencies.any? { |dep| dep.name == name && !dep.requirement.satisfied_by?(version) } - warn "WARNING: Disabled local dependency for #{name} because the gemspec disallows version #{version}." - next - end - gem name, path: "../#{name}" -end - -gem "google-style", "~> 1.30.1" -gem "minitest", "~> 5.22" -gem "minitest-focus", "~> 1.4" -gem "minitest-rg", "~> 5.3" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-retail/LICENSE.md b/owl-bot-staging/google-cloud-retail/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-retail/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/README.md b/owl-bot-staging/google-cloud-retail/README.md deleted file mode 100644 index ba0a543827bc..000000000000 --- a/owl-bot-staging/google-cloud-retail/README.md +++ /dev/null @@ -1,142 +0,0 @@ -# Ruby Client for the Retail API - -API Client library for the Retail API - -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. - -Actual client classes for the various versions of this API are defined in -_versioned_ client gems, with names of the form `google-cloud-retail-v*`. -The gem `google-cloud-retail` is the main client library that brings the -versioned gems in as dependencies, and provides high-level methods for -constructing clients. More information on versioned clients can be found below -in the section titled *Which client should I use?*. - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-retail/latest) -for this library, google-cloud-retail, to see the convenience methods for -constructing client objects. Reference documentation for the client objects -themselves can be found in the client library documentation for the versioned -client gems: -[google-cloud-retail-v2](https://cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest). - -See also the [Product Documentation](https://cloud.google.com/retail/docs/apis) -for more usage information. - -## Quick Start - -``` -$ gem install google-cloud-retail -``` - -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) - -```ruby -require "google/cloud/retail" - -client = Google::Cloud::Retail.analytics_service -request = ::Google::Cloud::Retail::V2::ExportAnalyticsMetricsRequest.new # (request fields as keyword arguments...) -response = client.export_analytics_metrics request -``` - -## 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. - -Debug logging also requires that the versioned clients for this service be -sufficiently recent, released after about Dec 10, 2024. If logging is not -working, try updating the versioned clients in your bundle or installed gems: -[google-cloud-retail-v2](https://cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest). - -## 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/Rakefile b/owl-bot-staging/google-cloud-retail/Rakefile deleted file mode 100644 index b6f97c47d721..000000000000 --- a/owl-bot-staging/google-cloud-retail/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 = true -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 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 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 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 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 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-retail" - header "google-cloud-retail rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-retail yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-retail 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 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 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/google-cloud-retail.gemspec b/owl-bot-staging/google-cloud-retail/google-cloud-retail.gemspec deleted file mode 100644 index 0e01c30630ad..000000000000 --- a/owl-bot-staging/google-cloud-retail/google-cloud-retail.gemspec +++ /dev/null @@ -1,27 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/retail/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-retail" - gem.version = Google::Cloud::Retail::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." - gem.summary = "API Client library for the Retail 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") + - ["README.md", "AUTHENTICATION.md", "LICENSE.md", ".yardopts"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 3.0" - - gem.add_dependency "google-cloud-core", "~> 1.6" - gem.add_dependency "google-cloud-retail-v2", "~> 2.0" -end diff --git a/owl-bot-staging/google-cloud-retail/lib/google-cloud-retail.rb b/owl-bot-staging/google-cloud-retail/lib/google-cloud-retail.rb deleted file mode 100644 index 5d5f31cfdc1d..000000000000 --- a/owl-bot-staging/google-cloud-retail/lib/google-cloud-retail.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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" unless defined? Google::Cloud::Retail::VERSION diff --git a/owl-bot-staging/google-cloud-retail/lib/google/cloud/retail.rb b/owl-bot-staging/google-cloud-retail/lib/google/cloud/retail.rb deleted file mode 100644 index a844c1427f76..000000000000 --- a/owl-bot-staging/google-cloud-retail/lib/google/cloud/retail.rb +++ /dev/null @@ -1,949 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# Require this file early so that the version constant gets defined before -# requiring "google/cloud". This is because google-cloud-core will load the -# entrypoint (gem name) file, which in turn re-requires this file (hence -# causing a require cycle) unless the version constant is already defined. -require "google/cloud/retail/version" - -require "googleauth" -gem "google-cloud-core" -require "google/cloud" unless defined? ::Google::Cloud.new -require "google/cloud/config" - -# Set the default configuration -::Google::Cloud.configure.add_config! :retail do |config| - config.add_field! :endpoint, nil, match: ::String - config.add_field! :credentials, nil, match: [::String, ::Hash, ::Google::Auth::Credentials] - config.add_field! :scope, nil, match: [::Array, ::String] - config.add_field! :lib_name, nil, match: ::String - config.add_field! :lib_version, nil, match: ::String - config.add_field! :interceptors, nil, match: ::Array - config.add_field! :timeout, nil, match: ::Numeric - config.add_field! :metadata, nil, match: ::Hash - config.add_field! :retry_policy, nil, match: [::Hash, ::Proc] - config.add_field! :quota_project, nil, match: ::String - config.add_field! :universe_domain, nil, match: ::String -end - -module Google - module Cloud - module Retail - ## - # Create a new client object for AnalyticsService. - # - # By default, this returns an instance of - # [Google::Cloud::Retail::V2::AnalyticsService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-AnalyticsService-Client) - # for a gRPC client for version V2 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the AnalyticsService service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the AnalyticsService service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Retail.analytics_service_available?}. - # - # ## About AnalyticsService - # - # Service for managing & accessing retail search business metric. - # Retail recommendation business metric is currently not available. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v2`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.analytics_service version: :v2, transport: :grpc, &block - require "google/cloud/retail/#{version.to_s.downcase}" - - package_name = Google::Cloud::Retail - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Retail.const_get(package_name).const_get(:AnalyticsService) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the AnalyticsService service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Retail.analytics_service}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the AnalyticsService service, - # or if the versioned client gem needs an update to support the AnalyticsService service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v2`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.analytics_service_available? version: :v2, transport: :grpc - require "google/cloud/retail/#{version.to_s.downcase}" - package_name = Google::Cloud::Retail - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Retail.const_get package_name - return false unless service_module.const_defined? :AnalyticsService - service_module = service_module.const_get :AnalyticsService - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for CatalogService. - # - # By default, this returns an instance of - # [Google::Cloud::Retail::V2::CatalogService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-CatalogService-Client) - # for a gRPC client for version V2 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the CatalogService service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the CatalogService service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Retail.catalog_service_available?}. - # - # ## About CatalogService - # - # Service for managing catalog configuration. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v2`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.catalog_service version: :v2, transport: :grpc, &block - require "google/cloud/retail/#{version.to_s.downcase}" - - package_name = Google::Cloud::Retail - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Retail.const_get(package_name).const_get(:CatalogService) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the CatalogService service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Retail.catalog_service}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the CatalogService service, - # or if the versioned client gem needs an update to support the CatalogService service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v2`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.catalog_service_available? version: :v2, transport: :grpc - require "google/cloud/retail/#{version.to_s.downcase}" - package_name = Google::Cloud::Retail - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Retail.const_get package_name - return false unless service_module.const_defined? :CatalogService - service_module = service_module.const_get :CatalogService - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for CompletionService. - # - # By default, this returns an instance of - # [Google::Cloud::Retail::V2::CompletionService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-CompletionService-Client) - # for a gRPC client for version V2 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the CompletionService service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the CompletionService service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Retail.completion_service_available?}. - # - # ## About 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. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v2`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.completion_service version: :v2, transport: :grpc, &block - require "google/cloud/retail/#{version.to_s.downcase}" - - package_name = Google::Cloud::Retail - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Retail.const_get(package_name).const_get(:CompletionService) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the CompletionService service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Retail.completion_service}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the CompletionService service, - # or if the versioned client gem needs an update to support the CompletionService service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v2`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.completion_service_available? version: :v2, transport: :grpc - require "google/cloud/retail/#{version.to_s.downcase}" - package_name = Google::Cloud::Retail - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Retail.const_get package_name - return false unless service_module.const_defined? :CompletionService - service_module = service_module.const_get :CompletionService - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for ControlService. - # - # By default, this returns an instance of - # [Google::Cloud::Retail::V2::ControlService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ControlService-Client) - # for a gRPC client for version V2 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the ControlService service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the ControlService service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Retail.control_service_available?}. - # - # ## About ControlService - # - # Service for modifying Control. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v2`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.control_service version: :v2, transport: :grpc, &block - require "google/cloud/retail/#{version.to_s.downcase}" - - package_name = Google::Cloud::Retail - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Retail.const_get(package_name).const_get(:ControlService) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the ControlService service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Retail.control_service}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the ControlService service, - # or if the versioned client gem needs an update to support the ControlService service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v2`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.control_service_available? version: :v2, transport: :grpc - require "google/cloud/retail/#{version.to_s.downcase}" - package_name = Google::Cloud::Retail - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Retail.const_get package_name - return false unless service_module.const_defined? :ControlService - service_module = service_module.const_get :ControlService - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for SearchService. - # - # By default, this returns an instance of - # [Google::Cloud::Retail::V2::SearchService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-SearchService-Client) - # for a gRPC client for version V2 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the SearchService service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the SearchService service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Retail.search_service_available?}. - # - # ## About 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. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v2`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.search_service version: :v2, transport: :grpc, &block - require "google/cloud/retail/#{version.to_s.downcase}" - - package_name = Google::Cloud::Retail - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Retail.const_get(package_name).const_get(:SearchService) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the SearchService service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Retail.search_service}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the SearchService service, - # or if the versioned client gem needs an update to support the SearchService service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v2`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.search_service_available? version: :v2, transport: :grpc - require "google/cloud/retail/#{version.to_s.downcase}" - package_name = Google::Cloud::Retail - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Retail.const_get package_name - return false unless service_module.const_defined? :SearchService - service_module = service_module.const_get :SearchService - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for ConversationalSearchService. - # - # By default, this returns an instance of - # [Google::Cloud::Retail::V2::ConversationalSearchService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ConversationalSearchService-Client) - # for a gRPC client for version V2 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the ConversationalSearchService service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the ConversationalSearchService service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Retail.conversational_search_service_available?}. - # - # ## About 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. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v2`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.conversational_search_service version: :v2, transport: :grpc, &block - require "google/cloud/retail/#{version.to_s.downcase}" - - package_name = Google::Cloud::Retail - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Retail.const_get(package_name).const_get(:ConversationalSearchService) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the ConversationalSearchService service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Retail.conversational_search_service}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the ConversationalSearchService service, - # or if the versioned client gem needs an update to support the ConversationalSearchService service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v2`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.conversational_search_service_available? version: :v2, transport: :grpc - require "google/cloud/retail/#{version.to_s.downcase}" - package_name = Google::Cloud::Retail - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Retail.const_get package_name - return false unless service_module.const_defined? :ConversationalSearchService - service_module = service_module.const_get :ConversationalSearchService - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for GenerativeQuestionService. - # - # By default, this returns an instance of - # [Google::Cloud::Retail::V2::GenerativeQuestionService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-GenerativeQuestionService-Client) - # for a gRPC client for version V2 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the GenerativeQuestionService service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the GenerativeQuestionService service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Retail.generative_question_service_available?}. - # - # ## About GenerativeQuestionService - # - # Service for managing LLM generated questions in search serving. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v2`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.generative_question_service version: :v2, transport: :grpc, &block - require "google/cloud/retail/#{version.to_s.downcase}" - - package_name = Google::Cloud::Retail - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Retail.const_get(package_name).const_get(:GenerativeQuestionService) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the GenerativeQuestionService service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Retail.generative_question_service}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the GenerativeQuestionService service, - # or if the versioned client gem needs an update to support the GenerativeQuestionService service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v2`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.generative_question_service_available? version: :v2, transport: :grpc - require "google/cloud/retail/#{version.to_s.downcase}" - package_name = Google::Cloud::Retail - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Retail.const_get package_name - return false unless service_module.const_defined? :GenerativeQuestionService - service_module = service_module.const_get :GenerativeQuestionService - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for ModelService. - # - # By default, this returns an instance of - # [Google::Cloud::Retail::V2::ModelService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ModelService-Client) - # for a gRPC client for version V2 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the ModelService service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the ModelService service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Retail.model_service_available?}. - # - # ## About ModelService - # - # 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. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v2`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.model_service version: :v2, transport: :grpc, &block - require "google/cloud/retail/#{version.to_s.downcase}" - - package_name = Google::Cloud::Retail - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Retail.const_get(package_name).const_get(:ModelService) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the ModelService service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Retail.model_service}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the ModelService service, - # or if the versioned client gem needs an update to support the ModelService service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v2`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.model_service_available? version: :v2, transport: :grpc - require "google/cloud/retail/#{version.to_s.downcase}" - package_name = Google::Cloud::Retail - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Retail.const_get package_name - return false unless service_module.const_defined? :ModelService - service_module = service_module.const_get :ModelService - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for PredictionService. - # - # By default, this returns an instance of - # [Google::Cloud::Retail::V2::PredictionService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-PredictionService-Client) - # for a gRPC client for version V2 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the PredictionService service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the PredictionService service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Retail.prediction_service_available?}. - # - # ## About PredictionService - # - # Service for making recommendation prediction. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v2`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.prediction_service version: :v2, transport: :grpc, &block - require "google/cloud/retail/#{version.to_s.downcase}" - - package_name = Google::Cloud::Retail - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Retail.const_get(package_name).const_get(:PredictionService) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the PredictionService service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Retail.prediction_service}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the PredictionService service, - # or if the versioned client gem needs an update to support the PredictionService service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v2`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.prediction_service_available? version: :v2, transport: :grpc - require "google/cloud/retail/#{version.to_s.downcase}" - package_name = Google::Cloud::Retail - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Retail.const_get package_name - return false unless service_module.const_defined? :PredictionService - service_module = service_module.const_get :PredictionService - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for ProductService. - # - # By default, this returns an instance of - # [Google::Cloud::Retail::V2::ProductService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ProductService-Client) - # for a gRPC client for version V2 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the ProductService service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the ProductService service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Retail.product_service_available?}. - # - # ## About ProductService - # - # Service for ingesting Product information - # of the customer's website. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v2`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.product_service version: :v2, transport: :grpc, &block - require "google/cloud/retail/#{version.to_s.downcase}" - - package_name = Google::Cloud::Retail - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Retail.const_get(package_name).const_get(:ProductService) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the ProductService service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Retail.product_service}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the ProductService service, - # or if the versioned client gem needs an update to support the ProductService service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v2`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.product_service_available? version: :v2, transport: :grpc - require "google/cloud/retail/#{version.to_s.downcase}" - package_name = Google::Cloud::Retail - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Retail.const_get package_name - return false unless service_module.const_defined? :ProductService - service_module = service_module.const_get :ProductService - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for ServingConfigService. - # - # By default, this returns an instance of - # [Google::Cloud::Retail::V2::ServingConfigService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ServingConfigService-Client) - # for a gRPC client for version V2 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the ServingConfigService service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the ServingConfigService service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Retail.serving_config_service_available?}. - # - # ## About ServingConfigService - # - # Service for modifying ServingConfig. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v2`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.serving_config_service version: :v2, transport: :grpc, &block - require "google/cloud/retail/#{version.to_s.downcase}" - - package_name = Google::Cloud::Retail - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Retail.const_get(package_name).const_get(:ServingConfigService) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the ServingConfigService service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Retail.serving_config_service}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the ServingConfigService service, - # or if the versioned client gem needs an update to support the ServingConfigService service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v2`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.serving_config_service_available? version: :v2, transport: :grpc - require "google/cloud/retail/#{version.to_s.downcase}" - package_name = Google::Cloud::Retail - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Retail.const_get package_name - return false unless service_module.const_defined? :ServingConfigService - service_module = service_module.const_get :ServingConfigService - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for UserEventService. - # - # By default, this returns an instance of - # [Google::Cloud::Retail::V2::UserEventService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-UserEventService-Client) - # for a gRPC client for version V2 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the UserEventService service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the UserEventService service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Retail.user_event_service_available?}. - # - # ## About UserEventService - # - # Service for ingesting end user actions on the customer website. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v2`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.user_event_service version: :v2, transport: :grpc, &block - require "google/cloud/retail/#{version.to_s.downcase}" - - package_name = Google::Cloud::Retail - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Retail.const_get(package_name).const_get(:UserEventService) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the UserEventService service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Retail.user_event_service}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the UserEventService service, - # or if the versioned client gem needs an update to support the UserEventService service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v2`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.user_event_service_available? version: :v2, transport: :grpc - require "google/cloud/retail/#{version.to_s.downcase}" - package_name = Google::Cloud::Retail - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Retail.const_get package_name - return false unless service_module.const_defined? :UserEventService - service_module = service_module.const_get :UserEventService - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Configure the google-cloud-retail library. - # - # The following configuration parameters are supported: - # - # * `credentials` (*type:* `String, Hash, Google::Auth::Credentials`) - - # The path to the keyfile as a String, the contents of the keyfile as a - # Hash, or a Google::Auth::Credentials object. - # * `lib_name` (*type:* `String`) - - # The library name as recorded in instrumentation and logging. - # * `lib_version` (*type:* `String`) - - # The library version as recorded in instrumentation and logging. - # * `interceptors` (*type:* `Array`) - - # An array of interceptors that are run before calls are executed. - # * `timeout` (*type:* `Numeric`) - - # Default timeout in seconds. - # * `metadata` (*type:* `Hash{Symbol=>String}`) - - # Additional headers to be sent with the call. - # * `retry_policy` (*type:* `Hash`) - - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - - # The error codes that should trigger a retry. - # - # @return [::Google::Cloud::Config] The default configuration used by this library - # - def self.configure - yield ::Google::Cloud.configure.retail if block_given? - - ::Google::Cloud.configure.retail - end - end - end -end - -helper_path = ::File.join __dir__, "retail", "helpers.rb" -require "google/cloud/retail/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-retail/lib/google/cloud/retail/version.rb b/owl-bot-staging/google-cloud-retail/lib/google/cloud/retail/version.rb deleted file mode 100644 index e74c93ac7413..000000000000 --- a/owl-bot-staging/google-cloud-retail/lib/google/cloud/retail/version.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! - - -module Google - module Cloud - module Retail - VERSION = "0.0.1" - end - end -end diff --git a/owl-bot-staging/google-cloud-retail/test/google/cloud/retail/client_test.rb b/owl-bot-staging/google-cloud-retail/test/google/cloud/retail/client_test.rb deleted file mode 100644 index 66c341b97da2..000000000000 --- a/owl-bot-staging/google-cloud-retail/test/google/cloud/retail/client_test.rb +++ /dev/null @@ -1,295 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "google/cloud/retail" -require "gapic/common" -require "gapic/grpc" -require "gapic/rest" - -class Google::Cloud::Retail::ClientConstructionMinitest < 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_analytics_service_grpc - skip unless Google::Cloud::Retail.analytics_service_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::Retail.analytics_service transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::Retail::V2::AnalyticsService::Client, client - end - end - - def test_analytics_service_rest - skip unless Google::Cloud::Retail.analytics_service_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Retail.analytics_service transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Retail::V2::AnalyticsService::Rest::Client, client - end - end - - def test_catalog_service_grpc - skip unless Google::Cloud::Retail.catalog_service_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::Retail.catalog_service transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::Retail::V2::CatalogService::Client, client - end - end - - def test_catalog_service_rest - skip unless Google::Cloud::Retail.catalog_service_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Retail.catalog_service transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Retail::V2::CatalogService::Rest::Client, client - end - end - - def test_completion_service_grpc - skip unless Google::Cloud::Retail.completion_service_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::Retail.completion_service transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::Retail::V2::CompletionService::Client, client - end - end - - def test_completion_service_rest - skip unless Google::Cloud::Retail.completion_service_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Retail.completion_service transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Retail::V2::CompletionService::Rest::Client, client - end - end - - def test_control_service_grpc - skip unless Google::Cloud::Retail.control_service_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::Retail.control_service transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::Retail::V2::ControlService::Client, client - end - end - - def test_control_service_rest - skip unless Google::Cloud::Retail.control_service_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Retail.control_service transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Retail::V2::ControlService::Rest::Client, client - end - end - - def test_search_service_grpc - skip unless Google::Cloud::Retail.search_service_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::Retail.search_service transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::Retail::V2::SearchService::Client, client - end - end - - def test_search_service_rest - skip unless Google::Cloud::Retail.search_service_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Retail.search_service transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Retail::V2::SearchService::Rest::Client, client - end - end - - def test_conversational_search_service_grpc - skip unless Google::Cloud::Retail.conversational_search_service_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::Retail.conversational_search_service transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::Retail::V2::ConversationalSearchService::Client, client - end - end - - def test_conversational_search_service_rest - skip unless Google::Cloud::Retail.conversational_search_service_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Retail.conversational_search_service transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Retail::V2::ConversationalSearchService::Rest::Client, client - end - end - - def test_generative_question_service_grpc - skip unless Google::Cloud::Retail.generative_question_service_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::Retail.generative_question_service transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::Retail::V2::GenerativeQuestionService::Client, client - end - end - - def test_generative_question_service_rest - skip unless Google::Cloud::Retail.generative_question_service_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Retail.generative_question_service transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Retail::V2::GenerativeQuestionService::Rest::Client, client - end - end - - def test_model_service_grpc - skip unless Google::Cloud::Retail.model_service_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::Retail.model_service transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::Retail::V2::ModelService::Client, client - end - end - - def test_model_service_rest - skip unless Google::Cloud::Retail.model_service_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Retail.model_service transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Retail::V2::ModelService::Rest::Client, client - end - end - - def test_prediction_service_grpc - skip unless Google::Cloud::Retail.prediction_service_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::Retail.prediction_service transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::Retail::V2::PredictionService::Client, client - end - end - - def test_prediction_service_rest - skip unless Google::Cloud::Retail.prediction_service_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Retail.prediction_service transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Retail::V2::PredictionService::Rest::Client, client - end - end - - def test_product_service_grpc - skip unless Google::Cloud::Retail.product_service_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::Retail.product_service transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::Retail::V2::ProductService::Client, client - end - end - - def test_product_service_rest - skip unless Google::Cloud::Retail.product_service_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Retail.product_service transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Retail::V2::ProductService::Rest::Client, client - end - end - - def test_serving_config_service_grpc - skip unless Google::Cloud::Retail.serving_config_service_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::Retail.serving_config_service transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::Retail::V2::ServingConfigService::Client, client - end - end - - def test_serving_config_service_rest - skip unless Google::Cloud::Retail.serving_config_service_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Retail.serving_config_service transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Retail::V2::ServingConfigService::Rest::Client, client - end - end - - def test_user_event_service_grpc - skip unless Google::Cloud::Retail.user_event_service_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::Retail.user_event_service transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::Retail::V2::UserEventService::Client, client - end - end - - def test_user_event_service_rest - skip unless Google::Cloud::Retail.user_event_service_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Retail.user_event_service transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Retail::V2::UserEventService::Rest::Client, client - end - end -end diff --git a/owl-bot-staging/google-cloud-retail/test/google/cloud/retail/version_test.rb b/owl-bot-staging/google-cloud-retail/test/google/cloud/retail/version_test.rb deleted file mode 100644 index d6b0727bd7a8..000000000000 --- a/owl-bot-staging/google-cloud-retail/test/google/cloud/retail/version_test.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 "helper" -require "google/cloud/retail/version" - -class Google::Cloud::Retail::VersionMinitest < Minitest::Test - def test_has_a_version - refute_nil Google::Cloud::Retail::VERSION - end -end diff --git a/owl-bot-staging/google-cloud-retail/test/helper.rb b/owl-bot-staging/google-cloud-retail/test/helper.rb deleted file mode 100644 index f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-retail/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/rg" - -require "grpc" - -require "ostruct" diff --git a/owl-bot-staging/google-cloud-run-client/.gitignore b/owl-bot-staging/google-cloud-run-client/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-run-client/.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-run-client/.repo-metadata.json b/owl-bot-staging/google-cloud-run-client/.repo-metadata.json deleted file mode 100644 index 4ae6c80548ae..000000000000 --- a/owl-bot-staging/google-cloud-run-client/.repo-metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "api_id": "run.googleapis.com", - "api_shortname": "run", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-run/latest", - "distribution_name": "google-cloud-run", - "is_cloud": true, - "language": "ruby", - "name": "run", - "name_pretty": "Cloud Run API", - "product_documentation": "https://cloud.google.com/run", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Cloud Run deploys and manages user provided container images that scale automatically based on incoming requests.", - "ruby-cloud-product-url": "https://cloud.google.com/run", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-run-client/.rubocop.yml b/owl-bot-staging/google-cloud-run-client/.rubocop.yml deleted file mode 100644 index ad7933d2c5c6..000000000000 --- a/owl-bot-staging/google-cloud-run-client/.rubocop.yml +++ /dev/null @@ -1,39 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-run.gemspec" - - "Rakefile" - - "acceptance/**/*" - - "test/**/*" - -Bundler/OrderedGems: - Enabled: false -Documentation: - Enabled: false -Layout/LineLength: - Enabled: false -Metrics/BlockLength: - Exclude: - - "samples/**/acceptance/*.rb" -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/FileName: - Exclude: - - "lib/google-cloud-run.rb" - -Style/BlockDelimiters: - Exclude: - - "samples/**/acceptance/*.rb" diff --git a/owl-bot-staging/google-cloud-run-client/.toys.rb b/owl-bot-staging/google-cloud-run-client/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-run-client/.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-run-client/.yardopts b/owl-bot-staging/google-cloud-run-client/.yardopts deleted file mode 100644 index a35195cf2f13..000000000000 --- a/owl-bot-staging/google-cloud-run-client/.yardopts +++ /dev/null @@ -1,11 +0,0 @@ ---no-private ---title="Cloud Run API" ---exclude _pb\.rb$ ---markup markdown ---markup-provider redcarpet - -./lib/**/*.rb -- -README.md -AUTHENTICATION.md -LICENSE.md diff --git a/owl-bot-staging/google-cloud-run-client/AUTHENTICATION.md b/owl-bot-staging/google-cloud-run-client/AUTHENTICATION.md deleted file mode 100644 index cb9bbe37a075..000000000000 --- a/owl-bot-staging/google-cloud-run-client/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-run 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-run 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/run" - -client = Google::Cloud::Run.builds do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/run" - -Google::Cloud::Run.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = Google::Cloud::Run.builds -``` - -### 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-run -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/run" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = Google::Cloud::Run.builds -``` - -### 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-run-client/CHANGELOG.md b/owl-bot-staging/google-cloud-run-client/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-run-client/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-run-client/Gemfile b/owl-bot-staging/google-cloud-run-client/Gemfile deleted file mode 100644 index 072162d17bd4..000000000000 --- a/owl-bot-staging/google-cloud-run-client/Gemfile +++ /dev/null @@ -1,28 +0,0 @@ -source "https://rubygems.org" - -gemspec - -local_dependencies = ["google-cloud-run-v2"] - -main_spec = gemspecs.last || Bundler.load_gemspec(File.join(__dir__, "google-cloud-run.gemspec")) -local_dependencies.each do |name| - spec_path = File.expand_path "../#{name}/#{name}.gemspec", __dir__ - unless File.file? spec_path - warn "WARNING: Disabled local dependency for #{name} because gemspec not found." - next - end - version = Bundler.load_gemspec(spec_path).version - if main_spec.dependencies.any? { |dep| dep.name == name && !dep.requirement.satisfied_by?(version) } - warn "WARNING: Disabled local dependency for #{name} because the gemspec disallows version #{version}." - next - end - gem name, path: "../#{name}" -end - -gem "google-style", "~> 1.30.1" -gem "minitest", "~> 5.22" -gem "minitest-focus", "~> 1.4" -gem "minitest-rg", "~> 5.3" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-run-client/LICENSE.md b/owl-bot-staging/google-cloud-run-client/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-run-client/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-run-client/README.md b/owl-bot-staging/google-cloud-run-client/README.md deleted file mode 100644 index f34a98840d4f..000000000000 --- a/owl-bot-staging/google-cloud-run-client/README.md +++ /dev/null @@ -1,142 +0,0 @@ -# Ruby Client for the Cloud Run API - -API Client library for the Cloud Run API - -Cloud Run deploys and manages user provided container images that scale automatically based on incoming requests. - -Actual client classes for the various versions of this API are defined in -_versioned_ client gems, with names of the form `google-cloud-run-v*`. -The gem `google-cloud-run` is the main client library that brings the -versioned gems in as dependencies, and provides high-level methods for -constructing clients. More information on versioned clients can be found below -in the section titled *Which client should I use?*. - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-run/latest) -for this library, google-cloud-run, to see the convenience methods for -constructing client objects. Reference documentation for the client objects -themselves can be found in the client library documentation for the versioned -client gems: -[google-cloud-run-v2](https://cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest). - -See also the [Product Documentation](https://cloud.google.com/run) -for more usage information. - -## Quick Start - -``` -$ gem install google-cloud-run -``` - -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/run.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -```ruby -require "google/cloud/run" - -client = Google::Cloud::Run.builds -request = ::Google::Cloud::Run::V2::SubmitBuildRequest.new # (request fields as keyword arguments...) -response = client.submit_build request -``` - -## 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. - -Debug logging also requires that the versioned clients for this service be -sufficiently recent, released after about Dec 10, 2024. If logging is not -working, try updating the versioned clients in your bundle or installed gems: -[google-cloud-run-v2](https://cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest). - -## 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-run`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-run-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-run`. -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-run-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-run-client/Rakefile b/owl-bot-staging/google-cloud-run-client/Rakefile deleted file mode 100644 index 7e92d30093b8..000000000000 --- a/owl-bot-staging/google-cloud-run-client/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 = true -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-run 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/run/v2/builds/credentials" - ::Google::Cloud::Run::V2::Builds::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-run 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-run 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-run 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-run gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-run" - header "google-cloud-run rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-run yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-run 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-run 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-run 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-run-client/google-cloud-run.gemspec b/owl-bot-staging/google-cloud-run-client/google-cloud-run.gemspec deleted file mode 100644 index cf668f5eda5a..000000000000 --- a/owl-bot-staging/google-cloud-run-client/google-cloud-run.gemspec +++ /dev/null @@ -1,27 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/run/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-run" - gem.version = Google::Cloud::Run::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Cloud Run deploys and manages user provided container images that scale automatically based on incoming requests." - gem.summary = "API Client library for the Cloud Run 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") + - ["README.md", "AUTHENTICATION.md", "LICENSE.md", ".yardopts"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 3.0" - - gem.add_dependency "google-cloud-core", "~> 1.6" - gem.add_dependency "google-cloud-run-v2", ">= 0.17", "< 2.a" -end diff --git a/owl-bot-staging/google-cloud-run-client/lib/google-cloud-run.rb b/owl-bot-staging/google-cloud-run-client/lib/google-cloud-run.rb deleted file mode 100644 index 5decb206ead1..000000000000 --- a/owl-bot-staging/google-cloud-run-client/lib/google-cloud-run.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/run" unless defined? Google::Cloud::Run::VERSION diff --git a/owl-bot-staging/google-cloud-run-client/lib/google/cloud/run.rb b/owl-bot-staging/google-cloud-run-client/lib/google/cloud/run.rb deleted file mode 100644 index 6a3aebbef5c9..000000000000 --- a/owl-bot-staging/google-cloud-run-client/lib/google/cloud/run.rb +++ /dev/null @@ -1,576 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# Require this file early so that the version constant gets defined before -# requiring "google/cloud". This is because google-cloud-core will load the -# entrypoint (gem name) file, which in turn re-requires this file (hence -# causing a require cycle) unless the version constant is already defined. -require "google/cloud/run/version" - -require "googleauth" -gem "google-cloud-core" -require "google/cloud" unless defined? ::Google::Cloud.new -require "google/cloud/config" - -# Set the default configuration -::Google::Cloud.configure.add_config! :run do |config| - config.add_field! :endpoint, nil, match: ::String - config.add_field! :credentials, nil, match: [::String, ::Hash, ::Google::Auth::Credentials] - config.add_field! :scope, nil, match: [::Array, ::String] - config.add_field! :lib_name, nil, match: ::String - config.add_field! :lib_version, nil, match: ::String - config.add_field! :interceptors, nil, match: ::Array - config.add_field! :timeout, nil, match: ::Numeric - config.add_field! :metadata, nil, match: ::Hash - config.add_field! :retry_policy, nil, match: [::Hash, ::Proc] - config.add_field! :quota_project, nil, match: ::String - config.add_field! :universe_domain, nil, match: ::String -end - -module Google - module Cloud - module Run - ## - # Create a new client object for Builds. - # - # By default, this returns an instance of - # [Google::Cloud::Run::V2::Builds::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest/Google-Cloud-Run-V2-Builds-Client) - # for a gRPC client for version V2 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the Builds service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the Builds service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Run.builds_available?}. - # - # ## About Builds - # - # Cloud Run Build Control Plane API - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v2`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.builds version: :v2, transport: :grpc, &block - require "google/cloud/run/#{version.to_s.downcase}" - - package_name = Google::Cloud::Run - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Run.const_get(package_name).const_get(:Builds) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the Builds service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Run.builds}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the Builds service, - # or if the versioned client gem needs an update to support the Builds service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v2`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.builds_available? version: :v2, transport: :grpc - require "google/cloud/run/#{version.to_s.downcase}" - package_name = Google::Cloud::Run - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Run.const_get package_name - return false unless service_module.const_defined? :Builds - service_module = service_module.const_get :Builds - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for Executions. - # - # By default, this returns an instance of - # [Google::Cloud::Run::V2::Executions::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest/Google-Cloud-Run-V2-Executions-Client) - # for a gRPC client for version V2 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the Executions service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the Executions service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Run.executions_available?}. - # - # ## About Executions - # - # Cloud Run Execution Control Plane API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v2`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.executions version: :v2, transport: :grpc, &block - require "google/cloud/run/#{version.to_s.downcase}" - - package_name = Google::Cloud::Run - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Run.const_get(package_name).const_get(:Executions) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the Executions service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Run.executions}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the Executions service, - # or if the versioned client gem needs an update to support the Executions service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v2`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.executions_available? version: :v2, transport: :grpc - require "google/cloud/run/#{version.to_s.downcase}" - package_name = Google::Cloud::Run - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Run.const_get package_name - return false unless service_module.const_defined? :Executions - service_module = service_module.const_get :Executions - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for Jobs. - # - # By default, this returns an instance of - # [Google::Cloud::Run::V2::Jobs::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest/Google-Cloud-Run-V2-Jobs-Client) - # for a gRPC client for version V2 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the Jobs service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the Jobs service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Run.jobs_available?}. - # - # ## About Jobs - # - # Cloud Run Job Control Plane API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v2`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.jobs version: :v2, transport: :grpc, &block - require "google/cloud/run/#{version.to_s.downcase}" - - package_name = Google::Cloud::Run - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Run.const_get(package_name).const_get(:Jobs) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the Jobs service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Run.jobs}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the Jobs service, - # or if the versioned client gem needs an update to support the Jobs service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v2`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.jobs_available? version: :v2, transport: :grpc - require "google/cloud/run/#{version.to_s.downcase}" - package_name = Google::Cloud::Run - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Run.const_get package_name - return false unless service_module.const_defined? :Jobs - service_module = service_module.const_get :Jobs - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for Revisions. - # - # By default, this returns an instance of - # [Google::Cloud::Run::V2::Revisions::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest/Google-Cloud-Run-V2-Revisions-Client) - # for a gRPC client for version V2 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the Revisions service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the Revisions service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Run.revisions_available?}. - # - # ## About Revisions - # - # Cloud Run Revision Control Plane API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v2`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.revisions version: :v2, transport: :grpc, &block - require "google/cloud/run/#{version.to_s.downcase}" - - package_name = Google::Cloud::Run - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Run.const_get(package_name).const_get(:Revisions) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the Revisions service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Run.revisions}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the Revisions service, - # or if the versioned client gem needs an update to support the Revisions service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v2`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.revisions_available? version: :v2, transport: :grpc - require "google/cloud/run/#{version.to_s.downcase}" - package_name = Google::Cloud::Run - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Run.const_get package_name - return false unless service_module.const_defined? :Revisions - service_module = service_module.const_get :Revisions - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for Services. - # - # By default, this returns an instance of - # [Google::Cloud::Run::V2::Services::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest/Google-Cloud-Run-V2-Services-Client) - # for a gRPC client for version V2 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the Services service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the Services service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Run.services_available?}. - # - # ## About Services - # - # Cloud Run Service Control Plane API - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v2`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.services version: :v2, transport: :grpc, &block - require "google/cloud/run/#{version.to_s.downcase}" - - package_name = Google::Cloud::Run - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Run.const_get(package_name).const_get(:Services) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the Services service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Run.services}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the Services service, - # or if the versioned client gem needs an update to support the Services service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v2`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.services_available? version: :v2, transport: :grpc - require "google/cloud/run/#{version.to_s.downcase}" - package_name = Google::Cloud::Run - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Run.const_get package_name - return false unless service_module.const_defined? :Services - service_module = service_module.const_get :Services - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for Tasks. - # - # By default, this returns an instance of - # [Google::Cloud::Run::V2::Tasks::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest/Google-Cloud-Run-V2-Tasks-Client) - # for a gRPC client for version V2 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the Tasks service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the Tasks service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Run.tasks_available?}. - # - # ## About Tasks - # - # Cloud Run Task Control Plane API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v2`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.tasks version: :v2, transport: :grpc, &block - require "google/cloud/run/#{version.to_s.downcase}" - - package_name = Google::Cloud::Run - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Run.const_get(package_name).const_get(:Tasks) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the Tasks service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Run.tasks}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the Tasks service, - # or if the versioned client gem needs an update to support the Tasks service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v2`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.tasks_available? version: :v2, transport: :grpc - require "google/cloud/run/#{version.to_s.downcase}" - package_name = Google::Cloud::Run - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Run.const_get package_name - return false unless service_module.const_defined? :Tasks - service_module = service_module.const_get :Tasks - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for WorkerPools. - # - # By default, this returns an instance of - # [Google::Cloud::Run::V2::WorkerPools::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest/Google-Cloud-Run-V2-WorkerPools-Client) - # for a gRPC client for version V2 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the WorkerPools service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the WorkerPools service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Run.worker_pools_available?}. - # - # ## About WorkerPools - # - # Cloud Run WorkerPool Control Plane API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v2`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.worker_pools version: :v2, transport: :grpc, &block - require "google/cloud/run/#{version.to_s.downcase}" - - package_name = Google::Cloud::Run - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Run.const_get(package_name).const_get(:WorkerPools) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the WorkerPools service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Run.worker_pools}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the WorkerPools service, - # or if the versioned client gem needs an update to support the WorkerPools service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v2`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.worker_pools_available? version: :v2, transport: :grpc - require "google/cloud/run/#{version.to_s.downcase}" - package_name = Google::Cloud::Run - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Run.const_get package_name - return false unless service_module.const_defined? :WorkerPools - service_module = service_module.const_get :WorkerPools - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Configure the google-cloud-run library. - # - # The following configuration parameters are supported: - # - # * `credentials` (*type:* `String, Hash, Google::Auth::Credentials`) - - # The path to the keyfile as a String, the contents of the keyfile as a - # Hash, or a Google::Auth::Credentials object. - # * `lib_name` (*type:* `String`) - - # The library name as recorded in instrumentation and logging. - # * `lib_version` (*type:* `String`) - - # The library version as recorded in instrumentation and logging. - # * `interceptors` (*type:* `Array`) - - # An array of interceptors that are run before calls are executed. - # * `timeout` (*type:* `Numeric`) - - # Default timeout in seconds. - # * `metadata` (*type:* `Hash{Symbol=>String}`) - - # Additional headers to be sent with the call. - # * `retry_policy` (*type:* `Hash`) - - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - - # The error codes that should trigger a retry. - # - # @return [::Google::Cloud::Config] The default configuration used by this library - # - def self.configure - yield ::Google::Cloud.configure.run if block_given? - - ::Google::Cloud.configure.run - end - end - end -end - -helper_path = ::File.join __dir__, "run", "helpers.rb" -require "google/cloud/run/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-run-client/lib/google/cloud/run/version.rb b/owl-bot-staging/google-cloud-run-client/lib/google/cloud/run/version.rb deleted file mode 100644 index 09106e21d937..000000000000 --- a/owl-bot-staging/google-cloud-run-client/lib/google/cloud/run/version.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! - - -module Google - module Cloud - module Run - VERSION = "0.0.1" - end - end -end diff --git a/owl-bot-staging/google-cloud-run-client/test/google/cloud/run/client_test.rb b/owl-bot-staging/google-cloud-run-client/test/google/cloud/run/client_test.rb deleted file mode 100644 index b6227307083d..000000000000 --- a/owl-bot-staging/google-cloud-run-client/test/google/cloud/run/client_test.rb +++ /dev/null @@ -1,190 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "google/cloud/run" -require "gapic/common" -require "gapic/grpc" -require "gapic/rest" - -class Google::Cloud::Run::ClientConstructionMinitest < 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_builds_grpc - skip unless Google::Cloud::Run.builds_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::Run.builds transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::Run::V2::Builds::Client, client - end - end - - def test_builds_rest - skip unless Google::Cloud::Run.builds_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Run.builds transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Run::V2::Builds::Rest::Client, client - end - end - - def test_executions_grpc - skip unless Google::Cloud::Run.executions_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::Run.executions transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::Run::V2::Executions::Client, client - end - end - - def test_executions_rest - skip unless Google::Cloud::Run.executions_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Run.executions transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Run::V2::Executions::Rest::Client, client - end - end - - def test_jobs_grpc - skip unless Google::Cloud::Run.jobs_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::Run.jobs transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::Run::V2::Jobs::Client, client - end - end - - def test_jobs_rest - skip unless Google::Cloud::Run.jobs_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Run.jobs transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Run::V2::Jobs::Rest::Client, client - end - end - - def test_revisions_grpc - skip unless Google::Cloud::Run.revisions_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::Run.revisions transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::Run::V2::Revisions::Client, client - end - end - - def test_revisions_rest - skip unless Google::Cloud::Run.revisions_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Run.revisions transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Run::V2::Revisions::Rest::Client, client - end - end - - def test_services_grpc - skip unless Google::Cloud::Run.services_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::Run.services transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::Run::V2::Services::Client, client - end - end - - def test_services_rest - skip unless Google::Cloud::Run.services_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Run.services transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Run::V2::Services::Rest::Client, client - end - end - - def test_tasks_grpc - skip unless Google::Cloud::Run.tasks_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::Run.tasks transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::Run::V2::Tasks::Client, client - end - end - - def test_tasks_rest - skip unless Google::Cloud::Run.tasks_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Run.tasks transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Run::V2::Tasks::Rest::Client, client - end - end - - def test_worker_pools_grpc - skip unless Google::Cloud::Run.worker_pools_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::Run.worker_pools transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::Run::V2::WorkerPools::Client, client - end - end - - def test_worker_pools_rest - skip unless Google::Cloud::Run.worker_pools_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Run.worker_pools transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Run::V2::WorkerPools::Rest::Client, client - end - end -end diff --git a/owl-bot-staging/google-cloud-run-client/test/google/cloud/run/version_test.rb b/owl-bot-staging/google-cloud-run-client/test/google/cloud/run/version_test.rb deleted file mode 100644 index 95d32d7c9348..000000000000 --- a/owl-bot-staging/google-cloud-run-client/test/google/cloud/run/version_test.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 "helper" -require "google/cloud/run/version" - -class Google::Cloud::Run::VersionMinitest < Minitest::Test - def test_has_a_version - refute_nil Google::Cloud::Run::VERSION - end -end diff --git a/owl-bot-staging/google-cloud-run-client/test/helper.rb b/owl-bot-staging/google-cloud-run-client/test/helper.rb deleted file mode 100644 index f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-run-client/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/rg" - -require "grpc" - -require "ostruct" 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 6442df18fa2f..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/Gemfile +++ /dev/null @@ -1,11 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.31.1" -gem "minitest", "~> 5.22" -gem "minitest-focus", "~> 1.4" -gem "minitest-rg", "~> 5.3" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-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 47e32029da1c..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.1" - - 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 a50b140d0058..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,58 +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\"\x91\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\"j\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\"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 - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module 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 1b89f673a7dd..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,73 +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 - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.cloud.saasplatform.saasservicemgmt.v1beta1.UnitVariable", "google/cloud/saasplatform/saasservicemgmt/v1beta1/common.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module 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 5941cded8b40..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,89 +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 - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.cloud.saasplatform.saasservicemgmt.v1beta1.Aggregate", "google/cloud/saasplatform/saasservicemgmt/v1beta1/common.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module 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 2ac0ad01734b..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,65 +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 - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.cloud.saasplatform.saasservicemgmt.v1beta1.Rollout", "google/cloud/saasplatform/saasservicemgmt/v1beta1/rollouts_resources.proto"], - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module 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 d59ba51a5612..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,473 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 - # @!attribute [rw] service_class_names - # @return [::Google::Protobuf::Map{::String => ::String}] - # Configure the Java class name to use instead of the service's for its - # corresponding generated GAPIC client. Keys are fully-qualified - # service names as they appear in the protobuf (including the full - # the language_settings.java.interface_names" field in gapic.yaml. API - # teams should otherwise use the service name as it appears in the - # protobuf. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class JavaSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ServiceClassNamesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for C++ client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class CppSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Php client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class PhpSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Python client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] experimental_features - # @return [::Google::Api::PythonSettings::ExperimentalFeatures] - # Experimental features to be included during client library generation. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Experimental features to be included during client library generation. - # These fields will be deprecated once the feature graduates and is enabled - # by default. - # @!attribute [rw] rest_async_io_enabled - # @return [::Boolean] - # Enables generation of asynchronous REST clients if `rest` transport is - # enabled. By default, asynchronous REST clients will not be generated. - # This feature will be enabled by default 1 month after launching the - # feature in preview packages. - # @!attribute [rw] protobuf_pythonic_types_enabled - # @return [::Boolean] - # Enables generation of protobuf code using new types that are more - # Pythonic which are included in `protobuf>=5.29.x`. This feature will be - # enabled by default 1 month after launching the feature in preview - # packages. - # @!attribute [rw] unversioned_package_disabled - # @return [::Boolean] - # Disables generation of an unversioned Python package for this client - # library. This means that the module names will need to be versioned in - # import statements. For example `import google.cloud.library_v2` instead - # of `import google.cloud.library`. - class ExperimentalFeatures - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Node client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class NodeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Dotnet client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from original service names to renamed versions. - # This is used when the default generated types - # would cause a naming conflict. (Neither name is - # fully-qualified.) - # Example: Subscriber to SubscriberServiceApi. - # @!attribute [rw] renamed_resources - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from full resource types to the effective short name - # for the resource. This is used when otherwise resource - # named from different services would cause naming collisions. - # Example entry: - # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - # @!attribute [rw] ignored_resources - # @return [::Array<::String>] - # List of full resource types to ignore during generation. - # This is typically used for API-specific Location resources, - # which should be handled by the generator as if they were actually - # the common Location resources. - # Example entry: "documentai.googleapis.com/Location" - # @!attribute [rw] forced_namespace_aliases - # @return [::Array<::String>] - # Namespaces which must be aliased in snippets due to - # a known (but non-generator-predictable) naming collision - # @!attribute [rw] handwritten_signatures - # @return [::Array<::String>] - # Method signatures (in the form "service.method(signature)") - # which are provided separately, so shouldn't be generated. - # Snippets *calling* these methods are still generated, however. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedResourcesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Ruby client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class RubySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Go client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map of service names to renamed services. Keys are the package relative - # service names and values are the name to be used for the service client - # and call options. - # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Describes the generator configuration for a method. - # @!attribute [rw] selector - # @return [::String] - # The fully qualified name of the method, for which the options below apply. - # This is used to find the method to apply the options. - # - # Example: - # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... - # @!attribute [rw] long_running - # @return [::Google::Api::MethodSettings::LongRunning] - # Describes settings to use for long-running operations when generating - # API methods for RPCs. Complements RPCs that use the annotations in - # google/longrunning/operations.proto. - # - # Example of a YAML configuration:: - # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes - # @!attribute [rw] auto_populated_fields - # @return [::Array<::String>] - # List of top-level fields of the request message, that should be - # automatically populated by the client libraries based on their - # (google.api.field_info).format. Currently supported format: UUID4. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id - class MethodSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes settings to use when generating API methods that use the - # long-running operation pattern. - # All default values below are from those used in the client library - # generators (e.g. - # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). - # @!attribute [rw] initial_poll_delay - # @return [::Google::Protobuf::Duration] - # Initial delay after which the first poll request will be made. - # Default value: 5 seconds. - # @!attribute [rw] poll_delay_multiplier - # @return [::Float] - # Multiplier to gradually increase delay between subsequent polls until it - # reaches max_poll_delay. - # Default value: 1.5. - # @!attribute [rw] max_poll_delay - # @return [::Google::Protobuf::Duration] - # Maximum time between two subsequent poll requests. - # Default value: 45 seconds. - # @!attribute [rw] total_poll_timeout - # @return [::Google::Protobuf::Duration] - # Total polling timeout. - # Default value: 5 minutes. - class LongRunning - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # This message is used to configure the generation of a subset of the RPCs in - # a service for client libraries. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - end -end diff --git a/owl-bot-staging/google-cloud-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 b868eddc20d9..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,231 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for 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 - 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 f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt-v1beta1/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/rg" - -require "grpc" - -require "ostruct" diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/.gitignore b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/.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/.repo-metadata.json b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/.repo-metadata.json deleted file mode 100644 index ab51463a9016..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/.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/latest", - "distribution_name": "google-cloud-saas_platform-saas_service_mgmt", - "is_cloud": true, - "language": "ruby", - "name": "saasservicemgmt", - "name_pretty": "SaaS Runtime 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.", - "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/.rubocop.yml b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/.rubocop.yml deleted file mode 100644 index ddc9f5e4cb50..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/.rubocop.yml +++ /dev/null @@ -1,39 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-saas_platform-saas_service_mgmt.gemspec" - - "Rakefile" - - "acceptance/**/*" - - "test/**/*" - -Bundler/OrderedGems: - Enabled: false -Documentation: - Enabled: false -Layout/LineLength: - Enabled: false -Metrics/BlockLength: - Exclude: - - "samples/**/acceptance/*.rb" -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/FileName: - Exclude: - - "lib/google-cloud-saas_platform-saas_service_mgmt.rb" - -Style/BlockDelimiters: - Exclude: - - "samples/**/acceptance/*.rb" diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/.toys.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/.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/.yardopts b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/.yardopts deleted file mode 100644 index 413e7197b7c6..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/.yardopts +++ /dev/null @@ -1,11 +0,0 @@ ---no-private ---title="SaaS Runtime API" ---exclude _pb\.rb$ ---markup markdown ---markup-provider redcarpet - -./lib/**/*.rb -- -README.md -AUTHENTICATION.md -LICENSE.md diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/AUTHENTICATION.md b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/AUTHENTICATION.md deleted file mode 100644 index 95988c838d8f..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-saas_platform-saas_service_mgmt 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 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" - -client = Google::Cloud::SaasPlatform::SaasServiceMgmt.saas_deployments 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" - -Google::Cloud::SaasPlatform::SaasServiceMgmt.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = Google::Cloud::SaasPlatform::SaasServiceMgmt.saas_deployments -``` - -### 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 -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" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = Google::Cloud::SaasPlatform::SaasServiceMgmt.saas_deployments -``` - -### 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/CHANGELOG.md b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/Gemfile b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/Gemfile deleted file mode 100644 index a3e9f8e344f3..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/Gemfile +++ /dev/null @@ -1,28 +0,0 @@ -source "https://rubygems.org" - -gemspec - -local_dependencies = ["google-cloud-saas_platform-saas_service_mgmt-v1beta1"] - -main_spec = gemspecs.last || Bundler.load_gemspec(File.join(__dir__, "google-cloud-saas_platform-saas_service_mgmt.gemspec")) -local_dependencies.each do |name| - spec_path = File.expand_path "../#{name}/#{name}.gemspec", __dir__ - unless File.file? spec_path - warn "WARNING: Disabled local dependency for #{name} because gemspec not found." - next - end - version = Bundler.load_gemspec(spec_path).version - if main_spec.dependencies.any? { |dep| dep.name == name && !dep.requirement.satisfied_by?(version) } - warn "WARNING: Disabled local dependency for #{name} because the gemspec disallows version #{version}." - next - end - gem name, path: "../#{name}" -end - -gem "google-style", "~> 1.30.1" -gem "minitest", "~> 5.22" -gem "minitest-focus", "~> 1.4" -gem "minitest-rg", "~> 5.3" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/LICENSE.md b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/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/README.md b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/README.md deleted file mode 100644 index 5dbf814c0a47..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/README.md +++ /dev/null @@ -1,142 +0,0 @@ -# Ruby Client for the SaaS Runtime 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. - -Actual client classes for the various versions of this API are defined in -_versioned_ client gems, with names of the form `google-cloud-saas_platform-saas_service_mgmt-v*`. -The gem `google-cloud-saas_platform-saas_service_mgmt` is the main client library that brings the -versioned gems in as dependencies, and provides high-level methods for -constructing clients. More information on versioned clients can be found below -in the section titled *Which client should I use?*. - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-saas_platform-saas_service_mgmt/latest) -for this library, google-cloud-saas_platform-saas_service_mgmt, to see the convenience methods for -constructing client objects. Reference documentation for the client objects -themselves can be found in the client library documentation for the versioned -client gems: -[google-cloud-saas_platform-saas_service_mgmt-v1beta1](https://cloud.google.com/ruby/docs/reference/google-cloud-saas_platform-saas_service_mgmt-v1beta1/latest). - -See also the [Product Documentation](https://cloud.google.com/saas-runtime/docs/overview) -for more usage information. - -## Quick Start - -``` -$ gem install google-cloud-saas_platform-saas_service_mgmt -``` - -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) - -```ruby -require "google/cloud/saas_platform/saas_service_mgmt" - -client = Google::Cloud::SaasPlatform::SaasServiceMgmt.saas_deployments -request = ::Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::ListSaasRequest.new # (request fields as keyword arguments...) -response = client.list_saas request -``` - -## 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. - -Debug logging also requires that the versioned clients for this service be -sufficiently recent, released after about Dec 10, 2024. If logging is not -working, try updating the versioned clients in your bundle or installed gems: -[google-cloud-saas_platform-saas_service_mgmt-v1beta1](https://cloud.google.com/ruby/docs/reference/google-cloud-saas_platform-saas_service_mgmt-v1beta1/latest). - -## 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/Rakefile b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/Rakefile deleted file mode 100644 index 10f8c02a616a..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/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 = true -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 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 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 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 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 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-saas_platform-saas_service_mgmt" - header "google-cloud-saas_platform-saas_service_mgmt rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-saas_platform-saas_service_mgmt yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-saas_platform-saas_service_mgmt 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 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 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/google-cloud-saas_platform-saas_service_mgmt.gemspec b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/google-cloud-saas_platform-saas_service_mgmt.gemspec deleted file mode 100644 index 814d68313c65..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/google-cloud-saas_platform-saas_service_mgmt.gemspec +++ /dev/null @@ -1,27 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/saas_platform/saas_service_mgmt/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-saas_platform-saas_service_mgmt" - gem.version = Google::Cloud::SaasPlatform::SaasServiceMgmt::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." - 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") + - ["README.md", "AUTHENTICATION.md", "LICENSE.md", ".yardopts"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 3.0" - - gem.add_dependency "google-cloud-core", "~> 1.6" - gem.add_dependency "google-cloud-saas_platform-saas_service_mgmt-v1beta1", ">= 0.0", "< 2.a" -end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/lib/google-cloud-saas_platform-saas_service_mgmt.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/lib/google-cloud-saas_platform-saas_service_mgmt.rb deleted file mode 100644 index 864dbb472e44..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/lib/google-cloud-saas_platform-saas_service_mgmt.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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" unless defined? Google::Cloud::SaasPlatform::SaasServiceMgmt::VERSION diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/lib/google/cloud/saas_platform/saas_service_mgmt.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/lib/google/cloud/saas_platform/saas_service_mgmt.rb deleted file mode 100644 index cfd06fa578f0..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/lib/google/cloud/saas_platform/saas_service_mgmt.rb +++ /dev/null @@ -1,228 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# Require this file early so that the version constant gets defined before -# requiring "google/cloud". This is because google-cloud-core will load the -# entrypoint (gem name) file, which in turn re-requires this file (hence -# causing a require cycle) unless the version constant is already defined. -require "google/cloud/saas_platform/saas_service_mgmt/version" - -require "googleauth" -gem "google-cloud-core" -require "google/cloud" unless defined? ::Google::Cloud.new -require "google/cloud/config" - -# Set the default configuration -::Google::Cloud.configure.add_config! :saas_platform_saas_service_mgmt do |config| - config.add_field! :endpoint, nil, match: ::String - config.add_field! :credentials, nil, match: [::String, ::Hash, ::Google::Auth::Credentials] - config.add_field! :scope, nil, match: [::Array, ::String] - config.add_field! :lib_name, nil, match: ::String - config.add_field! :lib_version, nil, match: ::String - config.add_field! :interceptors, nil, match: ::Array - config.add_field! :timeout, nil, match: ::Numeric - config.add_field! :metadata, nil, match: ::Hash - config.add_field! :retry_policy, nil, match: [::Hash, ::Proc] - config.add_field! :quota_project, nil, match: ::String - config.add_field! :universe_domain, nil, match: ::String -end - -module Google - module Cloud - module SaasPlatform - module SaasServiceMgmt - ## - # Create a new client object for SaasDeployments. - # - # By default, this returns an instance of - # [Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-saas_platform-saas_service_mgmt-v1beta1/latest/Google-Cloud-SaasPlatform-SaasServiceMgmt-V1beta1-SaasDeployments-Client) - # for a gRPC client for version V1beta1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the SaasDeployments service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the SaasDeployments service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::SaasPlatform::SaasServiceMgmt.saas_deployments_available?}. - # - # ## About SaasDeployments - # - # Manages the deployment of SaaS services. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1beta1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.saas_deployments version: :v1beta1, transport: :grpc, &block - require "google/cloud/saas_platform/saas_service_mgmt/#{version.to_s.downcase}" - - package_name = Google::Cloud::SaasPlatform::SaasServiceMgmt - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::SaasPlatform::SaasServiceMgmt.const_get(package_name).const_get(:SaasDeployments) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the SaasDeployments service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::SaasPlatform::SaasServiceMgmt.saas_deployments}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the SaasDeployments service, - # or if the versioned client gem needs an update to support the SaasDeployments service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1beta1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.saas_deployments_available? version: :v1beta1, transport: :grpc - require "google/cloud/saas_platform/saas_service_mgmt/#{version.to_s.downcase}" - package_name = Google::Cloud::SaasPlatform::SaasServiceMgmt - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::SaasPlatform::SaasServiceMgmt.const_get package_name - return false unless service_module.const_defined? :SaasDeployments - service_module = service_module.const_get :SaasDeployments - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for SaasRollouts. - # - # By default, this returns an instance of - # [Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-saas_platform-saas_service_mgmt-v1beta1/latest/Google-Cloud-SaasPlatform-SaasServiceMgmt-V1beta1-SaasRollouts-Client) - # for a gRPC client for version V1beta1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the SaasRollouts service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the SaasRollouts service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::SaasPlatform::SaasServiceMgmt.saas_rollouts_available?}. - # - # ## About SaasRollouts - # - # Manages the rollout of SaaS services. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1beta1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.saas_rollouts version: :v1beta1, transport: :grpc, &block - require "google/cloud/saas_platform/saas_service_mgmt/#{version.to_s.downcase}" - - package_name = Google::Cloud::SaasPlatform::SaasServiceMgmt - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::SaasPlatform::SaasServiceMgmt.const_get(package_name).const_get(:SaasRollouts) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the SaasRollouts service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::SaasPlatform::SaasServiceMgmt.saas_rollouts}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the SaasRollouts service, - # or if the versioned client gem needs an update to support the SaasRollouts service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1beta1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.saas_rollouts_available? version: :v1beta1, transport: :grpc - require "google/cloud/saas_platform/saas_service_mgmt/#{version.to_s.downcase}" - package_name = Google::Cloud::SaasPlatform::SaasServiceMgmt - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::SaasPlatform::SaasServiceMgmt.const_get package_name - return false unless service_module.const_defined? :SaasRollouts - service_module = service_module.const_get :SaasRollouts - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Configure the google-cloud-saas_platform-saas_service_mgmt library. - # - # The following configuration parameters are supported: - # - # * `credentials` (*type:* `String, Hash, Google::Auth::Credentials`) - - # The path to the keyfile as a String, the contents of the keyfile as a - # Hash, or a Google::Auth::Credentials object. - # * `lib_name` (*type:* `String`) - - # The library name as recorded in instrumentation and logging. - # * `lib_version` (*type:* `String`) - - # The library version as recorded in instrumentation and logging. - # * `interceptors` (*type:* `Array`) - - # An array of interceptors that are run before calls are executed. - # * `timeout` (*type:* `Numeric`) - - # Default timeout in seconds. - # * `metadata` (*type:* `Hash{Symbol=>String}`) - - # Additional headers to be sent with the call. - # * `retry_policy` (*type:* `Hash`) - - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - - # The error codes that should trigger a retry. - # - # @return [::Google::Cloud::Config] The default configuration used by this library - # - def self.configure - yield ::Google::Cloud.configure.saas_platform_saas_service_mgmt if block_given? - - ::Google::Cloud.configure.saas_platform_saas_service_mgmt - end - end - end - end -end - -helper_path = ::File.join __dir__, "saas_service_mgmt", "helpers.rb" -require "google/cloud/saas_platform/saas_service_mgmt/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/lib/google/cloud/saas_platform/saas_service_mgmt/version.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/lib/google/cloud/saas_platform/saas_service_mgmt/version.rb deleted file mode 100644 index 702f6d719d26..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/lib/google/cloud/saas_platform/saas_service_mgmt/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 SaasPlatform - module SaasServiceMgmt - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/test/google/cloud/saas_platform/saas_service_mgmt/client_test.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/test/google/cloud/saas_platform/saas_service_mgmt/client_test.rb deleted file mode 100644 index 75a386d33524..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/test/google/cloud/saas_platform/saas_service_mgmt/client_test.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! - -require "helper" -require "google/cloud/saas_platform/saas_service_mgmt" -require "gapic/common" -require "gapic/grpc" -require "gapic/rest" - -class Google::Cloud::SaasPlatform::SaasServiceMgmt::ClientConstructionMinitest < 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_saas_deployments_grpc - skip unless Google::Cloud::SaasPlatform::SaasServiceMgmt.saas_deployments_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::SaasPlatform::SaasServiceMgmt.saas_deployments transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Client, client - end - end - - def test_saas_deployments_rest - skip unless Google::Cloud::SaasPlatform::SaasServiceMgmt.saas_deployments_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::SaasPlatform::SaasServiceMgmt.saas_deployments transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasDeployments::Rest::Client, client - end - end - - def test_saas_rollouts_grpc - skip unless Google::Cloud::SaasPlatform::SaasServiceMgmt.saas_rollouts_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::SaasPlatform::SaasServiceMgmt.saas_rollouts transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Client, client - end - end - - def test_saas_rollouts_rest - skip unless Google::Cloud::SaasPlatform::SaasServiceMgmt.saas_rollouts_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::SaasPlatform::SaasServiceMgmt.saas_rollouts transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::SaasPlatform::SaasServiceMgmt::V1beta1::SaasRollouts::Rest::Client, client - end - end -end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/test/google/cloud/saas_platform/saas_service_mgmt/version_test.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/test/google/cloud/saas_platform/saas_service_mgmt/version_test.rb deleted file mode 100644 index b5ea633ed383..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/test/google/cloud/saas_platform/saas_service_mgmt/version_test.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 "helper" -require "google/cloud/saas_platform/saas_service_mgmt/version" - -class Google::Cloud::SaasPlatform::SaasServiceMgmt::VersionMinitest < Minitest::Test - def test_has_a_version - refute_nil Google::Cloud::SaasPlatform::SaasServiceMgmt::VERSION - end -end diff --git a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/test/helper.rb b/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/test/helper.rb deleted file mode 100644 index f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-saas_platform-saas_service_mgmt/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/rg" - -require "grpc" - -require "ostruct" 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 6442df18fa2f..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/Gemfile +++ /dev/null @@ -1,11 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.31.1" -gem "minitest", "~> 5.22" -gem "minitest-focus", "~> 1.4" -gem "minitest-rg", "~> 5.3" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-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 b1b1c971b3b6..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.1" - - 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 764d728f5d94..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloudscheduler_pb.rb +++ /dev/null @@ -1,60 +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 - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.cloud.scheduler.v1.Job", "google/cloud/scheduler/v1/job.proto"], - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module 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 6aad88a26522..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/job_pb.rb +++ /dev/null @@ -1,55 +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 - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.cloud.scheduler.v1.PubsubTarget", "google/cloud/scheduler/v1/target.proto"], - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.rpc.Status", "google/rpc/status.proto"], - ["google.protobuf.Duration", "google/protobuf/duration.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module 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 225bab1e093f..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/target_pb.rb +++ /dev/null @@ -1,50 +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 - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module 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 d59ba51a5612..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,473 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 - # @!attribute [rw] service_class_names - # @return [::Google::Protobuf::Map{::String => ::String}] - # Configure the Java class name to use instead of the service's for its - # corresponding generated GAPIC client. Keys are fully-qualified - # service names as they appear in the protobuf (including the full - # the language_settings.java.interface_names" field in gapic.yaml. API - # teams should otherwise use the service name as it appears in the - # protobuf. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class JavaSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ServiceClassNamesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for C++ client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class CppSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Php client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class PhpSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Python client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] experimental_features - # @return [::Google::Api::PythonSettings::ExperimentalFeatures] - # Experimental features to be included during client library generation. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Experimental features to be included during client library generation. - # These fields will be deprecated once the feature graduates and is enabled - # by default. - # @!attribute [rw] rest_async_io_enabled - # @return [::Boolean] - # Enables generation of asynchronous REST clients if `rest` transport is - # enabled. By default, asynchronous REST clients will not be generated. - # This feature will be enabled by default 1 month after launching the - # feature in preview packages. - # @!attribute [rw] protobuf_pythonic_types_enabled - # @return [::Boolean] - # Enables generation of protobuf code using new types that are more - # Pythonic which are included in `protobuf>=5.29.x`. This feature will be - # enabled by default 1 month after launching the feature in preview - # packages. - # @!attribute [rw] unversioned_package_disabled - # @return [::Boolean] - # Disables generation of an unversioned Python package for this client - # library. This means that the module names will need to be versioned in - # import statements. For example `import google.cloud.library_v2` instead - # of `import google.cloud.library`. - class ExperimentalFeatures - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Node client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class NodeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Dotnet client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from original service names to renamed versions. - # This is used when the default generated types - # would cause a naming conflict. (Neither name is - # fully-qualified.) - # Example: Subscriber to SubscriberServiceApi. - # @!attribute [rw] renamed_resources - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from full resource types to the effective short name - # for the resource. This is used when otherwise resource - # named from different services would cause naming collisions. - # Example entry: - # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - # @!attribute [rw] ignored_resources - # @return [::Array<::String>] - # List of full resource types to ignore during generation. - # This is typically used for API-specific Location resources, - # which should be handled by the generator as if they were actually - # the common Location resources. - # Example entry: "documentai.googleapis.com/Location" - # @!attribute [rw] forced_namespace_aliases - # @return [::Array<::String>] - # Namespaces which must be aliased in snippets due to - # a known (but non-generator-predictable) naming collision - # @!attribute [rw] handwritten_signatures - # @return [::Array<::String>] - # Method signatures (in the form "service.method(signature)") - # which are provided separately, so shouldn't be generated. - # Snippets *calling* these methods are still generated, however. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedResourcesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Ruby client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class RubySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Go client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map of service names to renamed services. Keys are the package relative - # service names and values are the name to be used for the service client - # and call options. - # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Describes the generator configuration for a method. - # @!attribute [rw] selector - # @return [::String] - # The fully qualified name of the method, for which the options below apply. - # This is used to find the method to apply the options. - # - # Example: - # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... - # @!attribute [rw] long_running - # @return [::Google::Api::MethodSettings::LongRunning] - # Describes settings to use for long-running operations when generating - # API methods for RPCs. Complements RPCs that use the annotations in - # google/longrunning/operations.proto. - # - # Example of a YAML configuration:: - # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes - # @!attribute [rw] auto_populated_fields - # @return [::Array<::String>] - # List of top-level fields of the request message, that should be - # automatically populated by the client libraries based on their - # (google.api.field_info).format. Currently supported format: UUID4. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id - class MethodSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes settings to use when generating API methods that use the - # long-running operation pattern. - # All default values below are from those used in the client library - # generators (e.g. - # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). - # @!attribute [rw] initial_poll_delay - # @return [::Google::Protobuf::Duration] - # Initial delay after which the first poll request will be made. - # Default value: 5 seconds. - # @!attribute [rw] poll_delay_multiplier - # @return [::Float] - # Multiplier to gradually increase delay between subsequent polls until it - # reaches max_poll_delay. - # Default value: 1.5. - # @!attribute [rw] max_poll_delay - # @return [::Google::Protobuf::Duration] - # Maximum time between two subsequent poll requests. - # Default value: 45 seconds. - # @!attribute [rw] total_poll_timeout - # @return [::Google::Protobuf::Duration] - # Total polling timeout. - # Default value: 5 minutes. - class LongRunning - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # This message is used to configure the generation of a subset of the RPCs in - # a service for client libraries. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - end -end diff --git a/owl-bot-staging/google-cloud-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 f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/rg" - -require "grpc" - -require "ostruct" 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 6442df18fa2f..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/Gemfile +++ /dev/null @@ -1,11 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.31.1" -gem "minitest", "~> 5.22" -gem "minitest-focus", "~> 1.4" -gem "minitest-rg", "~> 5.3" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-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 cfc2de299e77..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.1" - - 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 58cd615ab281..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/cloudscheduler_pb.rb +++ /dev/null @@ -1,60 +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 - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.cloud.scheduler.v1beta1.Job", "google/cloud/scheduler/v1beta1/job.proto"], - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module 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 f17ee354b46e..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/job_pb.rb +++ /dev/null @@ -1,55 +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 - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.cloud.scheduler.v1beta1.PubsubTarget", "google/cloud/scheduler/v1beta1/target.proto"], - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.rpc.Status", "google/rpc/status.proto"], - ["google.protobuf.Duration", "google/protobuf/duration.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module 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 77ece4cc9400..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/lib/google/cloud/scheduler/v1beta1/target_pb.rb +++ /dev/null @@ -1,50 +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 - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module 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 d59ba51a5612..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,473 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 - # @!attribute [rw] service_class_names - # @return [::Google::Protobuf::Map{::String => ::String}] - # Configure the Java class name to use instead of the service's for its - # corresponding generated GAPIC client. Keys are fully-qualified - # service names as they appear in the protobuf (including the full - # the language_settings.java.interface_names" field in gapic.yaml. API - # teams should otherwise use the service name as it appears in the - # protobuf. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class JavaSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ServiceClassNamesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for C++ client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class CppSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Php client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class PhpSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Python client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] experimental_features - # @return [::Google::Api::PythonSettings::ExperimentalFeatures] - # Experimental features to be included during client library generation. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Experimental features to be included during client library generation. - # These fields will be deprecated once the feature graduates and is enabled - # by default. - # @!attribute [rw] rest_async_io_enabled - # @return [::Boolean] - # Enables generation of asynchronous REST clients if `rest` transport is - # enabled. By default, asynchronous REST clients will not be generated. - # This feature will be enabled by default 1 month after launching the - # feature in preview packages. - # @!attribute [rw] protobuf_pythonic_types_enabled - # @return [::Boolean] - # Enables generation of protobuf code using new types that are more - # Pythonic which are included in `protobuf>=5.29.x`. This feature will be - # enabled by default 1 month after launching the feature in preview - # packages. - # @!attribute [rw] unversioned_package_disabled - # @return [::Boolean] - # Disables generation of an unversioned Python package for this client - # library. This means that the module names will need to be versioned in - # import statements. For example `import google.cloud.library_v2` instead - # of `import google.cloud.library`. - class ExperimentalFeatures - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Node client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class NodeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Dotnet client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from original service names to renamed versions. - # This is used when the default generated types - # would cause a naming conflict. (Neither name is - # fully-qualified.) - # Example: Subscriber to SubscriberServiceApi. - # @!attribute [rw] renamed_resources - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from full resource types to the effective short name - # for the resource. This is used when otherwise resource - # named from different services would cause naming collisions. - # Example entry: - # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - # @!attribute [rw] ignored_resources - # @return [::Array<::String>] - # List of full resource types to ignore during generation. - # This is typically used for API-specific Location resources, - # which should be handled by the generator as if they were actually - # the common Location resources. - # Example entry: "documentai.googleapis.com/Location" - # @!attribute [rw] forced_namespace_aliases - # @return [::Array<::String>] - # Namespaces which must be aliased in snippets due to - # a known (but non-generator-predictable) naming collision - # @!attribute [rw] handwritten_signatures - # @return [::Array<::String>] - # Method signatures (in the form "service.method(signature)") - # which are provided separately, so shouldn't be generated. - # Snippets *calling* these methods are still generated, however. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedResourcesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Ruby client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class RubySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Go client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map of service names to renamed services. Keys are the package relative - # service names and values are the name to be used for the service client - # and call options. - # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Describes the generator configuration for a method. - # @!attribute [rw] selector - # @return [::String] - # The fully qualified name of the method, for which the options below apply. - # This is used to find the method to apply the options. - # - # Example: - # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... - # @!attribute [rw] long_running - # @return [::Google::Api::MethodSettings::LongRunning] - # Describes settings to use for long-running operations when generating - # API methods for RPCs. Complements RPCs that use the annotations in - # google/longrunning/operations.proto. - # - # Example of a YAML configuration:: - # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes - # @!attribute [rw] auto_populated_fields - # @return [::Array<::String>] - # List of top-level fields of the request message, that should be - # automatically populated by the client libraries based on their - # (google.api.field_info).format. Currently supported format: UUID4. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id - class MethodSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes settings to use when generating API methods that use the - # long-running operation pattern. - # All default values below are from those used in the client library - # generators (e.g. - # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). - # @!attribute [rw] initial_poll_delay - # @return [::Google::Protobuf::Duration] - # Initial delay after which the first poll request will be made. - # Default value: 5 seconds. - # @!attribute [rw] poll_delay_multiplier - # @return [::Float] - # Multiplier to gradually increase delay between subsequent polls until it - # reaches max_poll_delay. - # Default value: 1.5. - # @!attribute [rw] max_poll_delay - # @return [::Google::Protobuf::Duration] - # Maximum time between two subsequent poll requests. - # Default value: 45 seconds. - # @!attribute [rw] total_poll_timeout - # @return [::Google::Protobuf::Duration] - # Total polling timeout. - # Default value: 5 minutes. - class LongRunning - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # This message is used to configure the generation of a subset of the RPCs in - # a service for client libraries. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - end -end diff --git a/owl-bot-staging/google-cloud-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 f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1beta1/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/rg" - -require "grpc" - -require "ostruct" diff --git a/owl-bot-staging/google-cloud-scheduler/.gitignore b/owl-bot-staging/google-cloud-scheduler/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-scheduler/.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/.repo-metadata.json b/owl-bot-staging/google-cloud-scheduler/.repo-metadata.json deleted file mode 100644 index fe18ddd5c2a0..000000000000 --- a/owl-bot-staging/google-cloud-scheduler/.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/latest", - "distribution_name": "google-cloud-scheduler", - "is_cloud": true, - "language": "ruby", - "name": "cloudscheduler", - "name_pretty": "Cloud Scheduler 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.", - "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/.rubocop.yml b/owl-bot-staging/google-cloud-scheduler/.rubocop.yml deleted file mode 100644 index 8b70a3970a2e..000000000000 --- a/owl-bot-staging/google-cloud-scheduler/.rubocop.yml +++ /dev/null @@ -1,39 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-scheduler.gemspec" - - "Rakefile" - - "acceptance/**/*" - - "test/**/*" - -Bundler/OrderedGems: - Enabled: false -Documentation: - Enabled: false -Layout/LineLength: - Enabled: false -Metrics/BlockLength: - Exclude: - - "samples/**/acceptance/*.rb" -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/FileName: - Exclude: - - "lib/google-cloud-scheduler.rb" - -Style/BlockDelimiters: - Exclude: - - "samples/**/acceptance/*.rb" diff --git a/owl-bot-staging/google-cloud-scheduler/.toys.rb b/owl-bot-staging/google-cloud-scheduler/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-scheduler/.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/.yardopts b/owl-bot-staging/google-cloud-scheduler/.yardopts deleted file mode 100644 index 0a96e817b4db..000000000000 --- a/owl-bot-staging/google-cloud-scheduler/.yardopts +++ /dev/null @@ -1,11 +0,0 @@ ---no-private ---title="Cloud Scheduler API" ---exclude _pb\.rb$ ---markup markdown ---markup-provider redcarpet - -./lib/**/*.rb -- -README.md -AUTHENTICATION.md -LICENSE.md diff --git a/owl-bot-staging/google-cloud-scheduler/AUTHENTICATION.md b/owl-bot-staging/google-cloud-scheduler/AUTHENTICATION.md deleted file mode 100644 index 2fc051ac6297..000000000000 --- a/owl-bot-staging/google-cloud-scheduler/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-scheduler 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 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" - -client = Google::Cloud::Scheduler.cloud_scheduler do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/scheduler" - -Google::Cloud::Scheduler.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = Google::Cloud::Scheduler.cloud_scheduler -``` - -### 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 -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" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = Google::Cloud::Scheduler.cloud_scheduler -``` - -### 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/CHANGELOG.md b/owl-bot-staging/google-cloud-scheduler/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-scheduler/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-scheduler/Gemfile b/owl-bot-staging/google-cloud-scheduler/Gemfile deleted file mode 100644 index 45bcbc8bf1ff..000000000000 --- a/owl-bot-staging/google-cloud-scheduler/Gemfile +++ /dev/null @@ -1,28 +0,0 @@ -source "https://rubygems.org" - -gemspec - -local_dependencies = ["google-cloud-scheduler-v1"] - -main_spec = gemspecs.last || Bundler.load_gemspec(File.join(__dir__, "google-cloud-scheduler.gemspec")) -local_dependencies.each do |name| - spec_path = File.expand_path "../#{name}/#{name}.gemspec", __dir__ - unless File.file? spec_path - warn "WARNING: Disabled local dependency for #{name} because gemspec not found." - next - end - version = Bundler.load_gemspec(spec_path).version - if main_spec.dependencies.any? { |dep| dep.name == name && !dep.requirement.satisfied_by?(version) } - warn "WARNING: Disabled local dependency for #{name} because the gemspec disallows version #{version}." - next - end - gem name, path: "../#{name}" -end - -gem "google-style", "~> 1.30.1" -gem "minitest", "~> 5.22" -gem "minitest-focus", "~> 1.4" -gem "minitest-rg", "~> 5.3" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-scheduler/LICENSE.md b/owl-bot-staging/google-cloud-scheduler/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-scheduler/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/README.md b/owl-bot-staging/google-cloud-scheduler/README.md deleted file mode 100644 index a2cf39c345db..000000000000 --- a/owl-bot-staging/google-cloud-scheduler/README.md +++ /dev/null @@ -1,142 +0,0 @@ -# Ruby Client for the Cloud Scheduler API - -API Client library for the Cloud Scheduler API - -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. - -Actual client classes for the various versions of this API are defined in -_versioned_ client gems, with names of the form `google-cloud-scheduler-v*`. -The gem `google-cloud-scheduler` is the main client library that brings the -versioned gems in as dependencies, and provides high-level methods for -constructing clients. More information on versioned clients can be found below -in the section titled *Which client should I use?*. - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-scheduler/latest) -for this library, google-cloud-scheduler, to see the convenience methods for -constructing client objects. Reference documentation for the client objects -themselves can be found in the client library documentation for the versioned -client gems: -[google-cloud-scheduler-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1/latest). - -See also the [Product Documentation](https://cloud.google.com/scheduler) -for more usage information. - -## Quick Start - -``` -$ gem install google-cloud-scheduler -``` - -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) - -```ruby -require "google/cloud/scheduler" - -client = Google::Cloud::Scheduler.cloud_scheduler -request = ::Google::Cloud::Scheduler::V1::ListJobsRequest.new # (request fields as keyword arguments...) -response = client.list_jobs request -``` - -## 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. - -Debug logging also requires that the versioned clients for this service be -sufficiently recent, released after about Dec 10, 2024. If logging is not -working, try updating the versioned clients in your bundle or installed gems: -[google-cloud-scheduler-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1/latest). - -## 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/Rakefile b/owl-bot-staging/google-cloud-scheduler/Rakefile deleted file mode 100644 index ca517666c458..000000000000 --- a/owl-bot-staging/google-cloud-scheduler/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 = true -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 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 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 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 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 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-scheduler" - header "google-cloud-scheduler rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-scheduler yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-scheduler 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 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 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/google-cloud-scheduler.gemspec b/owl-bot-staging/google-cloud-scheduler/google-cloud-scheduler.gemspec deleted file mode 100644 index ca6963afbf73..000000000000 --- a/owl-bot-staging/google-cloud-scheduler/google-cloud-scheduler.gemspec +++ /dev/null @@ -1,27 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/scheduler/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-scheduler" - gem.version = Google::Cloud::Scheduler::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." - gem.summary = "API Client library for the Cloud Scheduler 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") + - ["README.md", "AUTHENTICATION.md", "LICENSE.md", ".yardopts"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 3.0" - - gem.add_dependency "google-cloud-core", "~> 1.6" - gem.add_dependency "google-cloud-scheduler-v1", "~> 1.2" -end diff --git a/owl-bot-staging/google-cloud-scheduler/lib/google-cloud-scheduler.rb b/owl-bot-staging/google-cloud-scheduler/lib/google-cloud-scheduler.rb deleted file mode 100644 index 5dbd39bbc30f..000000000000 --- a/owl-bot-staging/google-cloud-scheduler/lib/google-cloud-scheduler.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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" unless defined? Google::Cloud::Scheduler::VERSION diff --git a/owl-bot-staging/google-cloud-scheduler/lib/google/cloud/scheduler.rb b/owl-bot-staging/google-cloud-scheduler/lib/google/cloud/scheduler.rb deleted file mode 100644 index a847287e7920..000000000000 --- a/owl-bot-staging/google-cloud-scheduler/lib/google/cloud/scheduler.rb +++ /dev/null @@ -1,157 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# Require this file early so that the version constant gets defined before -# requiring "google/cloud". This is because google-cloud-core will load the -# entrypoint (gem name) file, which in turn re-requires this file (hence -# causing a require cycle) unless the version constant is already defined. -require "google/cloud/scheduler/version" - -require "googleauth" -gem "google-cloud-core" -require "google/cloud" unless defined? ::Google::Cloud.new -require "google/cloud/config" - -# Set the default configuration -::Google::Cloud.configure.add_config! :scheduler do |config| - config.add_field! :endpoint, nil, match: ::String - config.add_field! :credentials, nil, match: [::String, ::Hash, ::Google::Auth::Credentials] - config.add_field! :scope, nil, match: [::Array, ::String] - config.add_field! :lib_name, nil, match: ::String - config.add_field! :lib_version, nil, match: ::String - config.add_field! :interceptors, nil, match: ::Array - config.add_field! :timeout, nil, match: ::Numeric - config.add_field! :metadata, nil, match: ::Hash - config.add_field! :retry_policy, nil, match: [::Hash, ::Proc] - config.add_field! :quota_project, nil, match: ::String - config.add_field! :universe_domain, nil, match: ::String -end - -module Google - module Cloud - module Scheduler - ## - # Create a new client object for CloudScheduler. - # - # By default, this returns an instance of - # [Google::Cloud::Scheduler::V1::CloudScheduler::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1/latest/Google-Cloud-Scheduler-V1-CloudScheduler-Client) - # for a gRPC client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the CloudScheduler service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the CloudScheduler service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Scheduler.cloud_scheduler_available?}. - # - # ## About CloudScheduler - # - # The Cloud Scheduler API allows external entities to reliably - # schedule asynchronous jobs. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.cloud_scheduler version: :v1, transport: :grpc, &block - require "google/cloud/scheduler/#{version.to_s.downcase}" - - package_name = Google::Cloud::Scheduler - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Scheduler.const_get(package_name).const_get(:CloudScheduler) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the CloudScheduler service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Scheduler.cloud_scheduler}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the CloudScheduler service, - # or if the versioned client gem needs an update to support the CloudScheduler service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.cloud_scheduler_available? version: :v1, transport: :grpc - require "google/cloud/scheduler/#{version.to_s.downcase}" - package_name = Google::Cloud::Scheduler - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Scheduler.const_get package_name - return false unless service_module.const_defined? :CloudScheduler - service_module = service_module.const_get :CloudScheduler - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Configure the google-cloud-scheduler library. - # - # The following configuration parameters are supported: - # - # * `credentials` (*type:* `String, Hash, Google::Auth::Credentials`) - - # The path to the keyfile as a String, the contents of the keyfile as a - # Hash, or a Google::Auth::Credentials object. - # * `lib_name` (*type:* `String`) - - # The library name as recorded in instrumentation and logging. - # * `lib_version` (*type:* `String`) - - # The library version as recorded in instrumentation and logging. - # * `interceptors` (*type:* `Array`) - - # An array of interceptors that are run before calls are executed. - # * `timeout` (*type:* `Numeric`) - - # Default timeout in seconds. - # * `metadata` (*type:* `Hash{Symbol=>String}`) - - # Additional headers to be sent with the call. - # * `retry_policy` (*type:* `Hash`) - - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - - # The error codes that should trigger a retry. - # - # @return [::Google::Cloud::Config] The default configuration used by this library - # - def self.configure - yield ::Google::Cloud.configure.scheduler if block_given? - - ::Google::Cloud.configure.scheduler - end - end - end -end - -helper_path = ::File.join __dir__, "scheduler", "helpers.rb" -require "google/cloud/scheduler/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-scheduler/lib/google/cloud/scheduler/version.rb b/owl-bot-staging/google-cloud-scheduler/lib/google/cloud/scheduler/version.rb deleted file mode 100644 index c4e8d11ea4bc..000000000000 --- a/owl-bot-staging/google-cloud-scheduler/lib/google/cloud/scheduler/version.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! - - -module Google - module Cloud - module Scheduler - VERSION = "0.0.1" - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler/test/google/cloud/scheduler/client_test.rb b/owl-bot-staging/google-cloud-scheduler/test/google/cloud/scheduler/client_test.rb deleted file mode 100644 index 5ab48d5d0553..000000000000 --- a/owl-bot-staging/google-cloud-scheduler/test/google/cloud/scheduler/client_test.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 "helper" -require "google/cloud/scheduler" -require "gapic/common" -require "gapic/grpc" -require "gapic/rest" - -class Google::Cloud::Scheduler::ClientConstructionMinitest < 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_cloud_scheduler_grpc - skip unless Google::Cloud::Scheduler.cloud_scheduler_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::Scheduler.cloud_scheduler transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::Scheduler::V1::CloudScheduler::Client, client - end - end - - def test_cloud_scheduler_rest - skip unless Google::Cloud::Scheduler.cloud_scheduler_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Scheduler.cloud_scheduler transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client, client - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler/test/google/cloud/scheduler/version_test.rb b/owl-bot-staging/google-cloud-scheduler/test/google/cloud/scheduler/version_test.rb deleted file mode 100644 index 02bfe3ac6be4..000000000000 --- a/owl-bot-staging/google-cloud-scheduler/test/google/cloud/scheduler/version_test.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 "helper" -require "google/cloud/scheduler/version" - -class Google::Cloud::Scheduler::VersionMinitest < Minitest::Test - def test_has_a_version - refute_nil Google::Cloud::Scheduler::VERSION - end -end diff --git a/owl-bot-staging/google-cloud-scheduler/test/helper.rb b/owl-bot-staging/google-cloud-scheduler/test/helper.rb deleted file mode 100644 index f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-scheduler/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/rg" - -require "grpc" - -require "ostruct" 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 6442df18fa2f..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/Gemfile +++ /dev/null @@ -1,11 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.31.1" -gem "minitest", "~> 5.22" -gem "minitest-focus", "~> 1.4" -gem "minitest-rg", "~> 5.3" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-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 fcfd382fc96e..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.1" - - 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 09df9c991633..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secretmanager/v1/resources_pb.rb +++ /dev/null @@ -1,64 +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 - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.protobuf.Duration", "google/protobuf/duration.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module 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 ce2e7a443885..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secretmanager/v1/service_pb.rb +++ /dev/null @@ -1,68 +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: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 - # @!attribute [rw] service_class_names - # @return [::Google::Protobuf::Map{::String => ::String}] - # Configure the Java class name to use instead of the service's for its - # corresponding generated GAPIC client. Keys are fully-qualified - # service names as they appear in the protobuf (including the full - # the language_settings.java.interface_names" field in gapic.yaml. API - # teams should otherwise use the service name as it appears in the - # protobuf. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class JavaSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ServiceClassNamesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for C++ client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class CppSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Php client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class PhpSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Python client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] experimental_features - # @return [::Google::Api::PythonSettings::ExperimentalFeatures] - # Experimental features to be included during client library generation. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Experimental features to be included during client library generation. - # These fields will be deprecated once the feature graduates and is enabled - # by default. - # @!attribute [rw] rest_async_io_enabled - # @return [::Boolean] - # Enables generation of asynchronous REST clients if `rest` transport is - # enabled. By default, asynchronous REST clients will not be generated. - # This feature will be enabled by default 1 month after launching the - # feature in preview packages. - # @!attribute [rw] protobuf_pythonic_types_enabled - # @return [::Boolean] - # Enables generation of protobuf code using new types that are more - # Pythonic which are included in `protobuf>=5.29.x`. This feature will be - # enabled by default 1 month after launching the feature in preview - # packages. - # @!attribute [rw] unversioned_package_disabled - # @return [::Boolean] - # Disables generation of an unversioned Python package for this client - # library. This means that the module names will need to be versioned in - # import statements. For example `import google.cloud.library_v2` instead - # of `import google.cloud.library`. - class ExperimentalFeatures - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Node client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class NodeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Dotnet client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from original service names to renamed versions. - # This is used when the default generated types - # would cause a naming conflict. (Neither name is - # fully-qualified.) - # Example: Subscriber to SubscriberServiceApi. - # @!attribute [rw] renamed_resources - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from full resource types to the effective short name - # for the resource. This is used when otherwise resource - # named from different services would cause naming collisions. - # Example entry: - # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - # @!attribute [rw] ignored_resources - # @return [::Array<::String>] - # List of full resource types to ignore during generation. - # This is typically used for API-specific Location resources, - # which should be handled by the generator as if they were actually - # the common Location resources. - # Example entry: "documentai.googleapis.com/Location" - # @!attribute [rw] forced_namespace_aliases - # @return [::Array<::String>] - # Namespaces which must be aliased in snippets due to - # a known (but non-generator-predictable) naming collision - # @!attribute [rw] handwritten_signatures - # @return [::Array<::String>] - # Method signatures (in the form "service.method(signature)") - # which are provided separately, so shouldn't be generated. - # Snippets *calling* these methods are still generated, however. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedResourcesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Ruby client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class RubySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Go client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map of service names to renamed services. Keys are the package relative - # service names and values are the name to be used for the service client - # and call options. - # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Describes the generator configuration for a method. - # @!attribute [rw] selector - # @return [::String] - # The fully qualified name of the method, for which the options below apply. - # This is used to find the method to apply the options. - # - # Example: - # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... - # @!attribute [rw] long_running - # @return [::Google::Api::MethodSettings::LongRunning] - # Describes settings to use for long-running operations when generating - # API methods for RPCs. Complements RPCs that use the annotations in - # google/longrunning/operations.proto. - # - # Example of a YAML configuration:: - # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes - # @!attribute [rw] auto_populated_fields - # @return [::Array<::String>] - # List of top-level fields of the request message, that should be - # automatically populated by the client libraries based on their - # (google.api.field_info).format. Currently supported format: UUID4. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id - class MethodSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes settings to use when generating API methods that use the - # long-running operation pattern. - # All default values below are from those used in the client library - # generators (e.g. - # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). - # @!attribute [rw] initial_poll_delay - # @return [::Google::Protobuf::Duration] - # Initial delay after which the first poll request will be made. - # Default value: 5 seconds. - # @!attribute [rw] poll_delay_multiplier - # @return [::Float] - # Multiplier to gradually increase delay between subsequent polls until it - # reaches max_poll_delay. - # Default value: 1.5. - # @!attribute [rw] max_poll_delay - # @return [::Google::Protobuf::Duration] - # Maximum time between two subsequent poll requests. - # Default value: 45 seconds. - # @!attribute [rw] total_poll_timeout - # @return [::Google::Protobuf::Duration] - # Total polling timeout. - # Default value: 5 minutes. - class LongRunning - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # This message is used to configure the generation of a subset of the RPCs in - # a service for client libraries. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - end -end diff --git a/owl-bot-staging/google-cloud-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 f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/rg" - -require "grpc" - -require "ostruct" 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 6442df18fa2f..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/Gemfile +++ /dev/null @@ -1,11 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.31.1" -gem "minitest", "~> 5.22" -gem "minitest-focus", "~> 1.4" -gem "minitest-rg", "~> 5.3" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-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 0606f2b840f3..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.1" - - 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 8868c322d3b9..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secrets/v1beta1/resources_pb.rb +++ /dev/null @@ -1,54 +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 - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module 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 c3109624dbec..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/lib/google/cloud/secrets/v1beta1/service_pb.rb +++ /dev/null @@ -1,68 +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 - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.cloud.secrets.v1beta1.Secret", "google/cloud/secrets/v1beta1/resources.proto"], - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module 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 d59ba51a5612..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,473 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 - # @!attribute [rw] service_class_names - # @return [::Google::Protobuf::Map{::String => ::String}] - # Configure the Java class name to use instead of the service's for its - # corresponding generated GAPIC client. Keys are fully-qualified - # service names as they appear in the protobuf (including the full - # the language_settings.java.interface_names" field in gapic.yaml. API - # teams should otherwise use the service name as it appears in the - # protobuf. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class JavaSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ServiceClassNamesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for C++ client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class CppSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Php client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class PhpSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Python client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] experimental_features - # @return [::Google::Api::PythonSettings::ExperimentalFeatures] - # Experimental features to be included during client library generation. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Experimental features to be included during client library generation. - # These fields will be deprecated once the feature graduates and is enabled - # by default. - # @!attribute [rw] rest_async_io_enabled - # @return [::Boolean] - # Enables generation of asynchronous REST clients if `rest` transport is - # enabled. By default, asynchronous REST clients will not be generated. - # This feature will be enabled by default 1 month after launching the - # feature in preview packages. - # @!attribute [rw] protobuf_pythonic_types_enabled - # @return [::Boolean] - # Enables generation of protobuf code using new types that are more - # Pythonic which are included in `protobuf>=5.29.x`. This feature will be - # enabled by default 1 month after launching the feature in preview - # packages. - # @!attribute [rw] unversioned_package_disabled - # @return [::Boolean] - # Disables generation of an unversioned Python package for this client - # library. This means that the module names will need to be versioned in - # import statements. For example `import google.cloud.library_v2` instead - # of `import google.cloud.library`. - class ExperimentalFeatures - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Node client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class NodeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Dotnet client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from original service names to renamed versions. - # This is used when the default generated types - # would cause a naming conflict. (Neither name is - # fully-qualified.) - # Example: Subscriber to SubscriberServiceApi. - # @!attribute [rw] renamed_resources - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from full resource types to the effective short name - # for the resource. This is used when otherwise resource - # named from different services would cause naming collisions. - # Example entry: - # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - # @!attribute [rw] ignored_resources - # @return [::Array<::String>] - # List of full resource types to ignore during generation. - # This is typically used for API-specific Location resources, - # which should be handled by the generator as if they were actually - # the common Location resources. - # Example entry: "documentai.googleapis.com/Location" - # @!attribute [rw] forced_namespace_aliases - # @return [::Array<::String>] - # Namespaces which must be aliased in snippets due to - # a known (but non-generator-predictable) naming collision - # @!attribute [rw] handwritten_signatures - # @return [::Array<::String>] - # Method signatures (in the form "service.method(signature)") - # which are provided separately, so shouldn't be generated. - # Snippets *calling* these methods are still generated, however. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedResourcesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Ruby client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class RubySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Go client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map of service names to renamed services. Keys are the package relative - # service names and values are the name to be used for the service client - # and call options. - # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Describes the generator configuration for a method. - # @!attribute [rw] selector - # @return [::String] - # The fully qualified name of the method, for which the options below apply. - # This is used to find the method to apply the options. - # - # Example: - # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... - # @!attribute [rw] long_running - # @return [::Google::Api::MethodSettings::LongRunning] - # Describes settings to use for long-running operations when generating - # API methods for RPCs. Complements RPCs that use the annotations in - # google/longrunning/operations.proto. - # - # Example of a YAML configuration:: - # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes - # @!attribute [rw] auto_populated_fields - # @return [::Array<::String>] - # List of top-level fields of the request message, that should be - # automatically populated by the client libraries based on their - # (google.api.field_info).format. Currently supported format: UUID4. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id - class MethodSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes settings to use when generating API methods that use the - # long-running operation pattern. - # All default values below are from those used in the client library - # generators (e.g. - # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). - # @!attribute [rw] initial_poll_delay - # @return [::Google::Protobuf::Duration] - # Initial delay after which the first poll request will be made. - # Default value: 5 seconds. - # @!attribute [rw] poll_delay_multiplier - # @return [::Float] - # Multiplier to gradually increase delay between subsequent polls until it - # reaches max_poll_delay. - # Default value: 1.5. - # @!attribute [rw] max_poll_delay - # @return [::Google::Protobuf::Duration] - # Maximum time between two subsequent poll requests. - # Default value: 45 seconds. - # @!attribute [rw] total_poll_timeout - # @return [::Google::Protobuf::Duration] - # Total polling timeout. - # Default value: 5 minutes. - class LongRunning - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # This message is used to configure the generation of a subset of the RPCs in - # a service for client libraries. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - end -end diff --git a/owl-bot-staging/google-cloud-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 f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta1/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/rg" - -require "grpc" - -require "ostruct" 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 6442df18fa2f..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/Gemfile +++ /dev/null @@ -1,11 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.31.1" -gem "minitest", "~> 5.22" -gem "minitest-focus", "~> 1.4" -gem "minitest-rg", "~> 5.3" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-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 8a4625b0efb0..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.1" - - 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 014897ad23f7..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secretmanager/v1beta2/resources_pb.rb +++ /dev/null @@ -1,64 +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 - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.protobuf.Duration", "google/protobuf/duration.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module 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 7921e025f19a..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/lib/google/cloud/secretmanager/v1beta2/service_pb.rb +++ /dev/null @@ -1,68 +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 - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.cloud.secretmanager.v1beta2.Secret", "google/cloud/secretmanager/v1beta2/resources.proto"], - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module 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 d59ba51a5612..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/proto_docs/google/api/client.rb +++ /dev/null @@ -1,473 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 - # @!attribute [rw] service_class_names - # @return [::Google::Protobuf::Map{::String => ::String}] - # Configure the Java class name to use instead of the service's for its - # corresponding generated GAPIC client. Keys are fully-qualified - # service names as they appear in the protobuf (including the full - # the language_settings.java.interface_names" field in gapic.yaml. API - # teams should otherwise use the service name as it appears in the - # protobuf. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class JavaSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ServiceClassNamesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for C++ client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class CppSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Php client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class PhpSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Python client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] experimental_features - # @return [::Google::Api::PythonSettings::ExperimentalFeatures] - # Experimental features to be included during client library generation. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Experimental features to be included during client library generation. - # These fields will be deprecated once the feature graduates and is enabled - # by default. - # @!attribute [rw] rest_async_io_enabled - # @return [::Boolean] - # Enables generation of asynchronous REST clients if `rest` transport is - # enabled. By default, asynchronous REST clients will not be generated. - # This feature will be enabled by default 1 month after launching the - # feature in preview packages. - # @!attribute [rw] protobuf_pythonic_types_enabled - # @return [::Boolean] - # Enables generation of protobuf code using new types that are more - # Pythonic which are included in `protobuf>=5.29.x`. This feature will be - # enabled by default 1 month after launching the feature in preview - # packages. - # @!attribute [rw] unversioned_package_disabled - # @return [::Boolean] - # Disables generation of an unversioned Python package for this client - # library. This means that the module names will need to be versioned in - # import statements. For example `import google.cloud.library_v2` instead - # of `import google.cloud.library`. - class ExperimentalFeatures - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Node client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class NodeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Dotnet client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from original service names to renamed versions. - # This is used when the default generated types - # would cause a naming conflict. (Neither name is - # fully-qualified.) - # Example: Subscriber to SubscriberServiceApi. - # @!attribute [rw] renamed_resources - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from full resource types to the effective short name - # for the resource. This is used when otherwise resource - # named from different services would cause naming collisions. - # Example entry: - # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - # @!attribute [rw] ignored_resources - # @return [::Array<::String>] - # List of full resource types to ignore during generation. - # This is typically used for API-specific Location resources, - # which should be handled by the generator as if they were actually - # the common Location resources. - # Example entry: "documentai.googleapis.com/Location" - # @!attribute [rw] forced_namespace_aliases - # @return [::Array<::String>] - # Namespaces which must be aliased in snippets due to - # a known (but non-generator-predictable) naming collision - # @!attribute [rw] handwritten_signatures - # @return [::Array<::String>] - # Method signatures (in the form "service.method(signature)") - # which are provided separately, so shouldn't be generated. - # Snippets *calling* these methods are still generated, however. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedResourcesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Ruby client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class RubySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Go client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map of service names to renamed services. Keys are the package relative - # service names and values are the name to be used for the service client - # and call options. - # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Describes the generator configuration for a method. - # @!attribute [rw] selector - # @return [::String] - # The fully qualified name of the method, for which the options below apply. - # This is used to find the method to apply the options. - # - # Example: - # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... - # @!attribute [rw] long_running - # @return [::Google::Api::MethodSettings::LongRunning] - # Describes settings to use for long-running operations when generating - # API methods for RPCs. Complements RPCs that use the annotations in - # google/longrunning/operations.proto. - # - # Example of a YAML configuration:: - # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes - # @!attribute [rw] auto_populated_fields - # @return [::Array<::String>] - # List of top-level fields of the request message, that should be - # automatically populated by the client libraries based on their - # (google.api.field_info).format. Currently supported format: UUID4. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id - class MethodSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes settings to use when generating API methods that use the - # long-running operation pattern. - # All default values below are from those used in the client library - # generators (e.g. - # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). - # @!attribute [rw] initial_poll_delay - # @return [::Google::Protobuf::Duration] - # Initial delay after which the first poll request will be made. - # Default value: 5 seconds. - # @!attribute [rw] poll_delay_multiplier - # @return [::Float] - # Multiplier to gradually increase delay between subsequent polls until it - # reaches max_poll_delay. - # Default value: 1.5. - # @!attribute [rw] max_poll_delay - # @return [::Google::Protobuf::Duration] - # Maximum time between two subsequent poll requests. - # Default value: 45 seconds. - # @!attribute [rw] total_poll_timeout - # @return [::Google::Protobuf::Duration] - # Total polling timeout. - # Default value: 5 minutes. - class LongRunning - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # This message is used to configure the generation of a subset of the RPCs in - # a service for client libraries. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - end -end diff --git a/owl-bot-staging/google-cloud-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 f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1beta2/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/rg" - -require "grpc" - -require "ostruct" diff --git a/owl-bot-staging/google-cloud-secret_manager/.gitignore b/owl-bot-staging/google-cloud-secret_manager/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager/.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/.repo-metadata.json b/owl-bot-staging/google-cloud-secret_manager/.repo-metadata.json deleted file mode 100644 index 2841043a0679..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager/.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/latest", - "distribution_name": "google-cloud-secret_manager", - "is_cloud": true, - "language": "ruby", - "name": "secretmanager", - "name_pretty": "Secret Manager 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.", - "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/.rubocop.yml b/owl-bot-staging/google-cloud-secret_manager/.rubocop.yml deleted file mode 100644 index f23c496220e0..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager/.rubocop.yml +++ /dev/null @@ -1,39 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-secret_manager.gemspec" - - "Rakefile" - - "acceptance/**/*" - - "test/**/*" - -Bundler/OrderedGems: - Enabled: false -Documentation: - Enabled: false -Layout/LineLength: - Enabled: false -Metrics/BlockLength: - Exclude: - - "samples/**/acceptance/*.rb" -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/FileName: - Exclude: - - "lib/google-cloud-secret_manager.rb" - -Style/BlockDelimiters: - Exclude: - - "samples/**/acceptance/*.rb" diff --git a/owl-bot-staging/google-cloud-secret_manager/.toys.rb b/owl-bot-staging/google-cloud-secret_manager/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager/.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/.yardopts b/owl-bot-staging/google-cloud-secret_manager/.yardopts deleted file mode 100644 index 124a053abd98..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager/.yardopts +++ /dev/null @@ -1,11 +0,0 @@ ---no-private ---title="Secret Manager API" ---exclude _pb\.rb$ ---markup markdown ---markup-provider redcarpet - -./lib/**/*.rb -- -README.md -AUTHENTICATION.md -LICENSE.md diff --git a/owl-bot-staging/google-cloud-secret_manager/AUTHENTICATION.md b/owl-bot-staging/google-cloud-secret_manager/AUTHENTICATION.md deleted file mode 100644 index 7fd185b48c4a..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-secret_manager 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 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" - -client = Google::Cloud::SecretManager.secret_manager_service do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/secret_manager" - -Google::Cloud::SecretManager.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = Google::Cloud::SecretManager.secret_manager_service -``` - -### 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 -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" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = Google::Cloud::SecretManager.secret_manager_service -``` - -### 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/CHANGELOG.md b/owl-bot-staging/google-cloud-secret_manager/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-secret_manager/Gemfile b/owl-bot-staging/google-cloud-secret_manager/Gemfile deleted file mode 100644 index 801e1a94d618..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager/Gemfile +++ /dev/null @@ -1,28 +0,0 @@ -source "https://rubygems.org" - -gemspec - -local_dependencies = ["google-cloud-secret_manager-v1"] - -main_spec = gemspecs.last || Bundler.load_gemspec(File.join(__dir__, "google-cloud-secret_manager.gemspec")) -local_dependencies.each do |name| - spec_path = File.expand_path "../#{name}/#{name}.gemspec", __dir__ - unless File.file? spec_path - warn "WARNING: Disabled local dependency for #{name} because gemspec not found." - next - end - version = Bundler.load_gemspec(spec_path).version - if main_spec.dependencies.any? { |dep| dep.name == name && !dep.requirement.satisfied_by?(version) } - warn "WARNING: Disabled local dependency for #{name} because the gemspec disallows version #{version}." - next - end - gem name, path: "../#{name}" -end - -gem "google-style", "~> 1.30.1" -gem "minitest", "~> 5.22" -gem "minitest-focus", "~> 1.4" -gem "minitest-rg", "~> 5.3" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-secret_manager/LICENSE.md b/owl-bot-staging/google-cloud-secret_manager/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager/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/README.md b/owl-bot-staging/google-cloud-secret_manager/README.md deleted file mode 100644 index d02c416d3958..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager/README.md +++ /dev/null @@ -1,142 +0,0 @@ -# Ruby Client for the Secret Manager API - -API Client library for the Secret Manager API - -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. - -Actual client classes for the various versions of this API are defined in -_versioned_ client gems, with names of the form `google-cloud-secret_manager-v*`. -The gem `google-cloud-secret_manager` is the main client library that brings the -versioned gems in as dependencies, and provides high-level methods for -constructing clients. More information on versioned clients can be found below -in the section titled *Which client should I use?*. - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-secret_manager/latest) -for this library, google-cloud-secret_manager, to see the convenience methods for -constructing client objects. Reference documentation for the client objects -themselves can be found in the client library documentation for the versioned -client gems: -[google-cloud-secret_manager-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1/latest). - -See also the [Product Documentation](https://cloud.google.com/secret-manager) -for more usage information. - -## Quick Start - -``` -$ gem install google-cloud-secret_manager -``` - -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) - -```ruby -require "google/cloud/secret_manager" - -client = Google::Cloud::SecretManager.secret_manager_service -request = ::Google::Cloud::SecretManager::V1::ListSecretsRequest.new # (request fields as keyword arguments...) -response = client.list_secrets request -``` - -## 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. - -Debug logging also requires that the versioned clients for this service be -sufficiently recent, released after about Dec 10, 2024. If logging is not -working, try updating the versioned clients in your bundle or installed gems: -[google-cloud-secret_manager-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1/latest). - -## 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/Rakefile b/owl-bot-staging/google-cloud-secret_manager/Rakefile deleted file mode 100644 index fde45ed3739d..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager/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 = true -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 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 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 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 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 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-secret_manager" - header "google-cloud-secret_manager rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-secret_manager yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-secret_manager 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 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 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/google-cloud-secret_manager.gemspec b/owl-bot-staging/google-cloud-secret_manager/google-cloud-secret_manager.gemspec deleted file mode 100644 index 9edde2a47779..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager/google-cloud-secret_manager.gemspec +++ /dev/null @@ -1,27 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/secret_manager/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-secret_manager" - gem.version = Google::Cloud::SecretManager::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." - gem.summary = "API Client library for the Secret Manager 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") + - ["README.md", "AUTHENTICATION.md", "LICENSE.md", ".yardopts"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 3.0" - - gem.add_dependency "google-cloud-core", "~> 1.6" - gem.add_dependency "google-cloud-secret_manager-v1", "~> 1.2" -end diff --git a/owl-bot-staging/google-cloud-secret_manager/lib/google-cloud-secret_manager.rb b/owl-bot-staging/google-cloud-secret_manager/lib/google-cloud-secret_manager.rb deleted file mode 100644 index ed54373735d2..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager/lib/google-cloud-secret_manager.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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" unless defined? Google::Cloud::SecretManager::VERSION diff --git a/owl-bot-staging/google-cloud-secret_manager/lib/google/cloud/secret_manager.rb b/owl-bot-staging/google-cloud-secret_manager/lib/google/cloud/secret_manager.rb deleted file mode 100644 index 23b7ef7b669d..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager/lib/google/cloud/secret_manager.rb +++ /dev/null @@ -1,153 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# Require this file early so that the version constant gets defined before -# requiring "google/cloud". This is because google-cloud-core will load the -# entrypoint (gem name) file, which in turn re-requires this file (hence -# causing a require cycle) unless the version constant is already defined. -require "google/cloud/secret_manager/version" - -require "googleauth" -gem "google-cloud-core" -require "google/cloud" unless defined? ::Google::Cloud.new -require "google/cloud/config" - -# Set the default configuration -::Google::Cloud.configure.add_config! :secret_manager do |config| - config.add_field! :endpoint, nil, match: ::String - config.add_field! :credentials, nil, match: [::String, ::Hash, ::Google::Auth::Credentials] - config.add_field! :scope, nil, match: [::Array, ::String] - config.add_field! :lib_name, nil, match: ::String - config.add_field! :lib_version, nil, match: ::String - config.add_field! :interceptors, nil, match: ::Array - config.add_field! :timeout, nil, match: ::Numeric - config.add_field! :metadata, nil, match: ::Hash - config.add_field! :retry_policy, nil, match: [::Hash, ::Proc] - config.add_field! :quota_project, nil, match: ::String - config.add_field! :universe_domain, nil, match: ::String -end - -module Google - module Cloud - module SecretManager - ## - # Create a new client object for SecretManagerService. - # - # By default, this returns an instance of - # [Google::Cloud::SecretManager::V1::SecretManagerService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1/latest/Google-Cloud-SecretManager-V1-SecretManagerService-Client) - # for a gRPC client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the SecretManagerService service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the SecretManagerService service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::SecretManager.secret_manager_service_available?}. - # - # ## About SecretManagerService - # - # Secret Manager Service - # - # Manages secrets and operations using those secrets. Implements a REST - # model with the following objects: - # - # * Secret - # * SecretVersion - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.secret_manager_service version: :v1, &block - require "google/cloud/secret_manager/#{version.to_s.downcase}" - - package_name = Google::Cloud::SecretManager - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::SecretManager.const_get(package_name).const_get(:SecretManagerService) - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the SecretManagerService service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::SecretManager.secret_manager_service}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the SecretManagerService service, - # or if the versioned client gem needs an update to support the SecretManagerService service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.secret_manager_service_available? version: :v1 - require "google/cloud/secret_manager/#{version.to_s.downcase}" - package_name = Google::Cloud::SecretManager - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::SecretManager.const_get package_name - return false unless service_module.const_defined? :SecretManagerService - service_module = service_module.const_get :SecretManagerService - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Configure the google-cloud-secret_manager library. - # - # The following configuration parameters are supported: - # - # * `credentials` (*type:* `String, Hash, Google::Auth::Credentials`) - - # The path to the keyfile as a String, the contents of the keyfile as a - # Hash, or a Google::Auth::Credentials object. - # * `lib_name` (*type:* `String`) - - # The library name as recorded in instrumentation and logging. - # * `lib_version` (*type:* `String`) - - # The library version as recorded in instrumentation and logging. - # * `interceptors` (*type:* `Array`) - - # An array of interceptors that are run before calls are executed. - # * `timeout` (*type:* `Numeric`) - - # Default timeout in seconds. - # * `metadata` (*type:* `Hash{Symbol=>String}`) - - # Additional headers to be sent with the call. - # * `retry_policy` (*type:* `Hash`) - - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - - # The error codes that should trigger a retry. - # - # @return [::Google::Cloud::Config] The default configuration used by this library - # - def self.configure - yield ::Google::Cloud.configure.secret_manager if block_given? - - ::Google::Cloud.configure.secret_manager - end - end - end -end - -helper_path = ::File.join __dir__, "secret_manager", "helpers.rb" -require "google/cloud/secret_manager/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-secret_manager/lib/google/cloud/secret_manager/version.rb b/owl-bot-staging/google-cloud-secret_manager/lib/google/cloud/secret_manager/version.rb deleted file mode 100644 index 7ca62e39649f..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager/lib/google/cloud/secret_manager/version.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! - - -module Google - module Cloud - module SecretManager - VERSION = "0.0.1" - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager/test/google/cloud/secret_manager/client_test.rb b/owl-bot-staging/google-cloud-secret_manager/test/google/cloud/secret_manager/client_test.rb deleted file mode 100644 index 9bf24e4ef2a7..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager/test/google/cloud/secret_manager/client_test.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 "helper" -require "google/cloud/secret_manager" -require "gapic/common" -require "gapic/grpc" - -class Google::Cloud::SecretManager::ClientConstructionMinitest < 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_secret_manager_service_grpc - skip unless Google::Cloud::SecretManager.secret_manager_service_available? - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::SecretManager.secret_manager_service do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::SecretManager::V1::SecretManagerService::Client, client - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager/test/google/cloud/secret_manager/version_test.rb b/owl-bot-staging/google-cloud-secret_manager/test/google/cloud/secret_manager/version_test.rb deleted file mode 100644 index 7188a10c49e1..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager/test/google/cloud/secret_manager/version_test.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 "helper" -require "google/cloud/secret_manager/version" - -class Google::Cloud::SecretManager::VersionMinitest < Minitest::Test - def test_has_a_version - refute_nil Google::Cloud::SecretManager::VERSION - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager/test/helper.rb b/owl-bot-staging/google-cloud-secret_manager/test/helper.rb deleted file mode 100644 index f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/rg" - -require "grpc" - -require "ostruct" 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 6442df18fa2f..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/Gemfile +++ /dev/null @@ -1,11 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.31.1" -gem "minitest", "~> 5.22" -gem "minitest-focus", "~> 1.4" -gem "minitest-rg", "~> 5.3" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-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 f5de10c34478..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.1" - - 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 d89058573db8..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/lib/google/cloud/securesourcemanager/v1/secure_source_manager_pb.rb +++ /dev/null @@ -1,148 +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 - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module 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 d59ba51a5612..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,473 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 - # @!attribute [rw] service_class_names - # @return [::Google::Protobuf::Map{::String => ::String}] - # Configure the Java class name to use instead of the service's for its - # corresponding generated GAPIC client. Keys are fully-qualified - # service names as they appear in the protobuf (including the full - # the language_settings.java.interface_names" field in gapic.yaml. API - # teams should otherwise use the service name as it appears in the - # protobuf. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class JavaSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ServiceClassNamesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for C++ client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class CppSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Php client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class PhpSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Python client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] experimental_features - # @return [::Google::Api::PythonSettings::ExperimentalFeatures] - # Experimental features to be included during client library generation. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Experimental features to be included during client library generation. - # These fields will be deprecated once the feature graduates and is enabled - # by default. - # @!attribute [rw] rest_async_io_enabled - # @return [::Boolean] - # Enables generation of asynchronous REST clients if `rest` transport is - # enabled. By default, asynchronous REST clients will not be generated. - # This feature will be enabled by default 1 month after launching the - # feature in preview packages. - # @!attribute [rw] protobuf_pythonic_types_enabled - # @return [::Boolean] - # Enables generation of protobuf code using new types that are more - # Pythonic which are included in `protobuf>=5.29.x`. This feature will be - # enabled by default 1 month after launching the feature in preview - # packages. - # @!attribute [rw] unversioned_package_disabled - # @return [::Boolean] - # Disables generation of an unversioned Python package for this client - # library. This means that the module names will need to be versioned in - # import statements. For example `import google.cloud.library_v2` instead - # of `import google.cloud.library`. - class ExperimentalFeatures - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Node client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class NodeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Dotnet client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from original service names to renamed versions. - # This is used when the default generated types - # would cause a naming conflict. (Neither name is - # fully-qualified.) - # Example: Subscriber to SubscriberServiceApi. - # @!attribute [rw] renamed_resources - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from full resource types to the effective short name - # for the resource. This is used when otherwise resource - # named from different services would cause naming collisions. - # Example entry: - # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - # @!attribute [rw] ignored_resources - # @return [::Array<::String>] - # List of full resource types to ignore during generation. - # This is typically used for API-specific Location resources, - # which should be handled by the generator as if they were actually - # the common Location resources. - # Example entry: "documentai.googleapis.com/Location" - # @!attribute [rw] forced_namespace_aliases - # @return [::Array<::String>] - # Namespaces which must be aliased in snippets due to - # a known (but non-generator-predictable) naming collision - # @!attribute [rw] handwritten_signatures - # @return [::Array<::String>] - # Method signatures (in the form "service.method(signature)") - # which are provided separately, so shouldn't be generated. - # Snippets *calling* these methods are still generated, however. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedResourcesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Ruby client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class RubySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Go client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map of service names to renamed services. Keys are the package relative - # service names and values are the name to be used for the service client - # and call options. - # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Describes the generator configuration for a method. - # @!attribute [rw] selector - # @return [::String] - # The fully qualified name of the method, for which the options below apply. - # This is used to find the method to apply the options. - # - # Example: - # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... - # @!attribute [rw] long_running - # @return [::Google::Api::MethodSettings::LongRunning] - # Describes settings to use for long-running operations when generating - # API methods for RPCs. Complements RPCs that use the annotations in - # google/longrunning/operations.proto. - # - # Example of a YAML configuration:: - # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes - # @!attribute [rw] auto_populated_fields - # @return [::Array<::String>] - # List of top-level fields of the request message, that should be - # automatically populated by the client libraries based on their - # (google.api.field_info).format. Currently supported format: UUID4. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id - class MethodSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes settings to use when generating API methods that use the - # long-running operation pattern. - # All default values below are from those used in the client library - # generators (e.g. - # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). - # @!attribute [rw] initial_poll_delay - # @return [::Google::Protobuf::Duration] - # Initial delay after which the first poll request will be made. - # Default value: 5 seconds. - # @!attribute [rw] poll_delay_multiplier - # @return [::Float] - # Multiplier to gradually increase delay between subsequent polls until it - # reaches max_poll_delay. - # Default value: 1.5. - # @!attribute [rw] max_poll_delay - # @return [::Google::Protobuf::Duration] - # Maximum time between two subsequent poll requests. - # Default value: 45 seconds. - # @!attribute [rw] total_poll_timeout - # @return [::Google::Protobuf::Duration] - # Total polling timeout. - # Default value: 5 minutes. - class LongRunning - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # This message is used to configure the generation of a subset of the RPCs in - # a service for client libraries. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - end -end diff --git a/owl-bot-staging/google-cloud-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 f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager-v1/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/rg" - -require "grpc" - -require "ostruct" diff --git a/owl-bot-staging/google-cloud-secure_source_manager/.gitignore b/owl-bot-staging/google-cloud-secure_source_manager/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager/.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/.repo-metadata.json b/owl-bot-staging/google-cloud-secure_source_manager/.repo-metadata.json deleted file mode 100644 index c96017f17418..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager/.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/latest", - "distribution_name": "google-cloud-secure_source_manager", - "is_cloud": true, - "language": "ruby", - "name": "securesourcemanager", - "name_pretty": "Secure Source Manager 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.", - "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/.rubocop.yml b/owl-bot-staging/google-cloud-secure_source_manager/.rubocop.yml deleted file mode 100644 index 39706a9e0bfe..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager/.rubocop.yml +++ /dev/null @@ -1,39 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-secure_source_manager.gemspec" - - "Rakefile" - - "acceptance/**/*" - - "test/**/*" - -Bundler/OrderedGems: - Enabled: false -Documentation: - Enabled: false -Layout/LineLength: - Enabled: false -Metrics/BlockLength: - Exclude: - - "samples/**/acceptance/*.rb" -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/FileName: - Exclude: - - "lib/google-cloud-secure_source_manager.rb" - -Style/BlockDelimiters: - Exclude: - - "samples/**/acceptance/*.rb" diff --git a/owl-bot-staging/google-cloud-secure_source_manager/.toys.rb b/owl-bot-staging/google-cloud-secure_source_manager/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager/.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/.yardopts b/owl-bot-staging/google-cloud-secure_source_manager/.yardopts deleted file mode 100644 index 5c99ec81c960..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager/.yardopts +++ /dev/null @@ -1,11 +0,0 @@ ---no-private ---title="Secure Source Manager API" ---exclude _pb\.rb$ ---markup markdown ---markup-provider redcarpet - -./lib/**/*.rb -- -README.md -AUTHENTICATION.md -LICENSE.md diff --git a/owl-bot-staging/google-cloud-secure_source_manager/AUTHENTICATION.md b/owl-bot-staging/google-cloud-secure_source_manager/AUTHENTICATION.md deleted file mode 100644 index 70e84a04d138..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-secure_source_manager 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 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" - -client = Google::Cloud::SecureSourceManager.secure_source_manager 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" - -Google::Cloud::SecureSourceManager.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = Google::Cloud::SecureSourceManager.secure_source_manager -``` - -### 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 -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" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = Google::Cloud::SecureSourceManager.secure_source_manager -``` - -### 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/CHANGELOG.md b/owl-bot-staging/google-cloud-secure_source_manager/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-secure_source_manager/Gemfile b/owl-bot-staging/google-cloud-secure_source_manager/Gemfile deleted file mode 100644 index 8dd2f3e61bd5..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager/Gemfile +++ /dev/null @@ -1,28 +0,0 @@ -source "https://rubygems.org" - -gemspec - -local_dependencies = ["google-cloud-secure_source_manager-v1"] - -main_spec = gemspecs.last || Bundler.load_gemspec(File.join(__dir__, "google-cloud-secure_source_manager.gemspec")) -local_dependencies.each do |name| - spec_path = File.expand_path "../#{name}/#{name}.gemspec", __dir__ - unless File.file? spec_path - warn "WARNING: Disabled local dependency for #{name} because gemspec not found." - next - end - version = Bundler.load_gemspec(spec_path).version - if main_spec.dependencies.any? { |dep| dep.name == name && !dep.requirement.satisfied_by?(version) } - warn "WARNING: Disabled local dependency for #{name} because the gemspec disallows version #{version}." - next - end - gem name, path: "../#{name}" -end - -gem "google-style", "~> 1.30.1" -gem "minitest", "~> 5.22" -gem "minitest-focus", "~> 1.4" -gem "minitest-rg", "~> 5.3" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-secure_source_manager/LICENSE.md b/owl-bot-staging/google-cloud-secure_source_manager/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager/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/README.md b/owl-bot-staging/google-cloud-secure_source_manager/README.md deleted file mode 100644 index 626209d4b024..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager/README.md +++ /dev/null @@ -1,142 +0,0 @@ -# Ruby Client for the Secure Source Manager 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. - -Actual client classes for the various versions of this API are defined in -_versioned_ client gems, with names of the form `google-cloud-secure_source_manager-v*`. -The gem `google-cloud-secure_source_manager` is the main client library that brings the -versioned gems in as dependencies, and provides high-level methods for -constructing clients. More information on versioned clients can be found below -in the section titled *Which client should I use?*. - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-secure_source_manager/latest) -for this library, google-cloud-secure_source_manager, to see the convenience methods for -constructing client objects. Reference documentation for the client objects -themselves can be found in the client library documentation for the versioned -client gems: -[google-cloud-secure_source_manager-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-secure_source_manager-v1/latest). - -See also the [Product Documentation](https://cloud.google.com/secure-source-manager/docs/overview) -for more usage information. - -## Quick Start - -``` -$ gem install google-cloud-secure_source_manager -``` - -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) - -```ruby -require "google/cloud/secure_source_manager" - -client = Google::Cloud::SecureSourceManager.secure_source_manager -request = ::Google::Cloud::SecureSourceManager::V1::ListInstancesRequest.new # (request fields as keyword arguments...) -response = client.list_instances request -``` - -## 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. - -Debug logging also requires that the versioned clients for this service be -sufficiently recent, released after about Dec 10, 2024. If logging is not -working, try updating the versioned clients in your bundle or installed gems: -[google-cloud-secure_source_manager-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-secure_source_manager-v1/latest). - -## 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/Rakefile b/owl-bot-staging/google-cloud-secure_source_manager/Rakefile deleted file mode 100644 index c7970accf7b4..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager/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 = true -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 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 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 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 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 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-secure_source_manager" - header "google-cloud-secure_source_manager rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-secure_source_manager yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-secure_source_manager 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 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 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/google-cloud-secure_source_manager.gemspec b/owl-bot-staging/google-cloud-secure_source_manager/google-cloud-secure_source_manager.gemspec deleted file mode 100644 index e662ca03a727..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager/google-cloud-secure_source_manager.gemspec +++ /dev/null @@ -1,27 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/secure_source_manager/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-secure_source_manager" - gem.version = Google::Cloud::SecureSourceManager::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." - 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") + - ["README.md", "AUTHENTICATION.md", "LICENSE.md", ".yardopts"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 3.0" - - gem.add_dependency "google-cloud-core", "~> 1.6" - gem.add_dependency "google-cloud-secure_source_manager-v1", "~> 2.0" -end diff --git a/owl-bot-staging/google-cloud-secure_source_manager/lib/google-cloud-secure_source_manager.rb b/owl-bot-staging/google-cloud-secure_source_manager/lib/google-cloud-secure_source_manager.rb deleted file mode 100644 index 268a417c2881..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager/lib/google-cloud-secure_source_manager.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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" unless defined? Google::Cloud::SecureSourceManager::VERSION diff --git a/owl-bot-staging/google-cloud-secure_source_manager/lib/google/cloud/secure_source_manager.rb b/owl-bot-staging/google-cloud-secure_source_manager/lib/google/cloud/secure_source_manager.rb deleted file mode 100644 index d303d76e6126..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager/lib/google/cloud/secure_source_manager.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 this file early so that the version constant gets defined before -# requiring "google/cloud". This is because google-cloud-core will load the -# entrypoint (gem name) file, which in turn re-requires this file (hence -# causing a require cycle) unless the version constant is already defined. -require "google/cloud/secure_source_manager/version" - -require "googleauth" -gem "google-cloud-core" -require "google/cloud" unless defined? ::Google::Cloud.new -require "google/cloud/config" - -# Set the default configuration -::Google::Cloud.configure.add_config! :secure_source_manager do |config| - config.add_field! :endpoint, nil, match: ::String - config.add_field! :credentials, nil, match: [::String, ::Hash, ::Google::Auth::Credentials] - config.add_field! :scope, nil, match: [::Array, ::String] - config.add_field! :lib_name, nil, match: ::String - config.add_field! :lib_version, nil, match: ::String - config.add_field! :interceptors, nil, match: ::Array - config.add_field! :timeout, nil, match: ::Numeric - config.add_field! :metadata, nil, match: ::Hash - config.add_field! :retry_policy, nil, match: [::Hash, ::Proc] - config.add_field! :quota_project, nil, match: ::String - config.add_field! :universe_domain, nil, match: ::String -end - -module Google - module Cloud - module SecureSourceManager - ## - # Create a new client object for SecureSourceManager. - # - # By default, this returns an instance of - # [Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-secure_source_manager-v1/latest/Google-Cloud-SecureSourceManager-V1-SecureSourceManager-Client) - # for a gRPC client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the SecureSourceManager service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the SecureSourceManager service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::SecureSourceManager.secure_source_manager_available?}. - # - # ## About SecureSourceManager - # - # Secure Source Manager API - # - # Access Secure Source Manager instances, resources, and repositories. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.secure_source_manager version: :v1, transport: :grpc, &block - require "google/cloud/secure_source_manager/#{version.to_s.downcase}" - - package_name = Google::Cloud::SecureSourceManager - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::SecureSourceManager.const_get(package_name).const_get(:SecureSourceManager) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the SecureSourceManager service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::SecureSourceManager.secure_source_manager}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the SecureSourceManager service, - # or if the versioned client gem needs an update to support the SecureSourceManager service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.secure_source_manager_available? version: :v1, transport: :grpc - require "google/cloud/secure_source_manager/#{version.to_s.downcase}" - package_name = Google::Cloud::SecureSourceManager - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::SecureSourceManager.const_get package_name - return false unless service_module.const_defined? :SecureSourceManager - service_module = service_module.const_get :SecureSourceManager - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Configure the google-cloud-secure_source_manager library. - # - # The following configuration parameters are supported: - # - # * `credentials` (*type:* `String, Hash, Google::Auth::Credentials`) - - # The path to the keyfile as a String, the contents of the keyfile as a - # Hash, or a Google::Auth::Credentials object. - # * `lib_name` (*type:* `String`) - - # The library name as recorded in instrumentation and logging. - # * `lib_version` (*type:* `String`) - - # The library version as recorded in instrumentation and logging. - # * `interceptors` (*type:* `Array`) - - # An array of interceptors that are run before calls are executed. - # * `timeout` (*type:* `Numeric`) - - # Default timeout in seconds. - # * `metadata` (*type:* `Hash{Symbol=>String}`) - - # Additional headers to be sent with the call. - # * `retry_policy` (*type:* `Hash`) - - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - - # The error codes that should trigger a retry. - # - # @return [::Google::Cloud::Config] The default configuration used by this library - # - def self.configure - yield ::Google::Cloud.configure.secure_source_manager if block_given? - - ::Google::Cloud.configure.secure_source_manager - end - end - end -end - -helper_path = ::File.join __dir__, "secure_source_manager", "helpers.rb" -require "google/cloud/secure_source_manager/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-secure_source_manager/lib/google/cloud/secure_source_manager/version.rb b/owl-bot-staging/google-cloud-secure_source_manager/lib/google/cloud/secure_source_manager/version.rb deleted file mode 100644 index 3e29de4e1fc7..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager/lib/google/cloud/secure_source_manager/version.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! - - -module Google - module Cloud - module SecureSourceManager - VERSION = "0.0.1" - end - end -end diff --git a/owl-bot-staging/google-cloud-secure_source_manager/test/google/cloud/secure_source_manager/client_test.rb b/owl-bot-staging/google-cloud-secure_source_manager/test/google/cloud/secure_source_manager/client_test.rb deleted file mode 100644 index 190212437d4c..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager/test/google/cloud/secure_source_manager/client_test.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 "helper" -require "google/cloud/secure_source_manager" -require "gapic/common" -require "gapic/grpc" -require "gapic/rest" - -class Google::Cloud::SecureSourceManager::ClientConstructionMinitest < 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_secure_source_manager_grpc - skip unless Google::Cloud::SecureSourceManager.secure_source_manager_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::SecureSourceManager.secure_source_manager transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Client, client - end - end - - def test_secure_source_manager_rest - skip unless Google::Cloud::SecureSourceManager.secure_source_manager_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::SecureSourceManager.secure_source_manager transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::SecureSourceManager::V1::SecureSourceManager::Rest::Client, client - end - end -end diff --git a/owl-bot-staging/google-cloud-secure_source_manager/test/google/cloud/secure_source_manager/version_test.rb b/owl-bot-staging/google-cloud-secure_source_manager/test/google/cloud/secure_source_manager/version_test.rb deleted file mode 100644 index bd800a9c364b..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager/test/google/cloud/secure_source_manager/version_test.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 "helper" -require "google/cloud/secure_source_manager/version" - -class Google::Cloud::SecureSourceManager::VersionMinitest < Minitest::Test - def test_has_a_version - refute_nil Google::Cloud::SecureSourceManager::VERSION - end -end diff --git a/owl-bot-staging/google-cloud-secure_source_manager/test/helper.rb b/owl-bot-staging/google-cloud-secure_source_manager/test/helper.rb deleted file mode 100644 index f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-secure_source_manager/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/rg" - -require "grpc" - -require "ostruct" 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 6442df18fa2f..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/Gemfile +++ /dev/null @@ -1,11 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.31.1" -gem "minitest", "~> 5.22" -gem "minitest-focus", "~> 1.4" -gem "minitest-rg", "~> 5.3" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-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 41395182ee5c..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.1" - - 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 6bac8662d5d4..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/privateca/v1/resources_pb.rb +++ /dev/null @@ -1,104 +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 - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Duration", "google/protobuf/duration.proto"], - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.type.Expr", "google/type/expr.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module 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 f376a66b6bcb..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/lib/google/cloud/security/privateca/v1/service_pb.rb +++ /dev/null @@ -1,95 +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 - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.cloud.security.privateca.v1.Certificate", "google/cloud/security/privateca/v1/resources.proto"], - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module 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 d59ba51a5612..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,473 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 - # @!attribute [rw] service_class_names - # @return [::Google::Protobuf::Map{::String => ::String}] - # Configure the Java class name to use instead of the service's for its - # corresponding generated GAPIC client. Keys are fully-qualified - # service names as they appear in the protobuf (including the full - # the language_settings.java.interface_names" field in gapic.yaml. API - # teams should otherwise use the service name as it appears in the - # protobuf. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class JavaSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ServiceClassNamesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for C++ client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class CppSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Php client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class PhpSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Python client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] experimental_features - # @return [::Google::Api::PythonSettings::ExperimentalFeatures] - # Experimental features to be included during client library generation. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Experimental features to be included during client library generation. - # These fields will be deprecated once the feature graduates and is enabled - # by default. - # @!attribute [rw] rest_async_io_enabled - # @return [::Boolean] - # Enables generation of asynchronous REST clients if `rest` transport is - # enabled. By default, asynchronous REST clients will not be generated. - # This feature will be enabled by default 1 month after launching the - # feature in preview packages. - # @!attribute [rw] protobuf_pythonic_types_enabled - # @return [::Boolean] - # Enables generation of protobuf code using new types that are more - # Pythonic which are included in `protobuf>=5.29.x`. This feature will be - # enabled by default 1 month after launching the feature in preview - # packages. - # @!attribute [rw] unversioned_package_disabled - # @return [::Boolean] - # Disables generation of an unversioned Python package for this client - # library. This means that the module names will need to be versioned in - # import statements. For example `import google.cloud.library_v2` instead - # of `import google.cloud.library`. - class ExperimentalFeatures - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Node client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class NodeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Dotnet client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from original service names to renamed versions. - # This is used when the default generated types - # would cause a naming conflict. (Neither name is - # fully-qualified.) - # Example: Subscriber to SubscriberServiceApi. - # @!attribute [rw] renamed_resources - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from full resource types to the effective short name - # for the resource. This is used when otherwise resource - # named from different services would cause naming collisions. - # Example entry: - # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - # @!attribute [rw] ignored_resources - # @return [::Array<::String>] - # List of full resource types to ignore during generation. - # This is typically used for API-specific Location resources, - # which should be handled by the generator as if they were actually - # the common Location resources. - # Example entry: "documentai.googleapis.com/Location" - # @!attribute [rw] forced_namespace_aliases - # @return [::Array<::String>] - # Namespaces which must be aliased in snippets due to - # a known (but non-generator-predictable) naming collision - # @!attribute [rw] handwritten_signatures - # @return [::Array<::String>] - # Method signatures (in the form "service.method(signature)") - # which are provided separately, so shouldn't be generated. - # Snippets *calling* these methods are still generated, however. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedResourcesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Ruby client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class RubySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Go client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map of service names to renamed services. Keys are the package relative - # service names and values are the name to be used for the service client - # and call options. - # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Describes the generator configuration for a method. - # @!attribute [rw] selector - # @return [::String] - # The fully qualified name of the method, for which the options below apply. - # This is used to find the method to apply the options. - # - # Example: - # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... - # @!attribute [rw] long_running - # @return [::Google::Api::MethodSettings::LongRunning] - # Describes settings to use for long-running operations when generating - # API methods for RPCs. Complements RPCs that use the annotations in - # google/longrunning/operations.proto. - # - # Example of a YAML configuration:: - # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes - # @!attribute [rw] auto_populated_fields - # @return [::Array<::String>] - # List of top-level fields of the request message, that should be - # automatically populated by the client libraries based on their - # (google.api.field_info).format. Currently supported format: UUID4. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id - class MethodSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes settings to use when generating API methods that use the - # long-running operation pattern. - # All default values below are from those used in the client library - # generators (e.g. - # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). - # @!attribute [rw] initial_poll_delay - # @return [::Google::Protobuf::Duration] - # Initial delay after which the first poll request will be made. - # Default value: 5 seconds. - # @!attribute [rw] poll_delay_multiplier - # @return [::Float] - # Multiplier to gradually increase delay between subsequent polls until it - # reaches max_poll_delay. - # Default value: 1.5. - # @!attribute [rw] max_poll_delay - # @return [::Google::Protobuf::Duration] - # Maximum time between two subsequent poll requests. - # Default value: 45 seconds. - # @!attribute [rw] total_poll_timeout - # @return [::Google::Protobuf::Duration] - # Total polling timeout. - # Default value: 5 minutes. - class LongRunning - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # This message is used to configure the generation of a subset of the RPCs in - # a service for client libraries. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - end -end diff --git a/owl-bot-staging/google-cloud-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 f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-security-private_ca-v1/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/rg" - -require "grpc" - -require "ostruct"